mirror of
https://github.com/flarum/core.git
synced 2025-07-30 21:20:24 +02:00
Fix tests and CS
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Tests\Flarum\Api\Handler;
|
||||
|
||||
use Exception;
|
||||
use Flarum\Api\Handler\InvalidConfirmationTokenExceptionHandler;
|
||||
use Flarum\Core\Exception\InvalidConfirmationTokenException;
|
||||
use Tests\Test\TestCase;
|
||||
@@ -16,7 +26,7 @@ class InvalidConfirmationTokenExceptionHandlerTest extends TestCase
|
||||
|
||||
public function test_it_handles_recognisable_exceptions()
|
||||
{
|
||||
$this->assertFalse($this->handler->manages(new \Exception));
|
||||
$this->assertFalse($this->handler->manages(new Exception));
|
||||
$this->assertTrue($this->handler->manages(new InvalidConfirmationTokenException));
|
||||
}
|
||||
|
||||
@@ -25,6 +35,11 @@ class InvalidConfirmationTokenExceptionHandlerTest extends TestCase
|
||||
$response = $this->handler->handle(new InvalidConfirmationTokenException);
|
||||
|
||||
$this->assertEquals(403, $response->getStatus());
|
||||
$this->assertEquals([['code' => 'invalid_confirmation_token']], $response->getErrors());
|
||||
$this->assertEquals([
|
||||
[
|
||||
'status' => '403',
|
||||
'code' => 'invalid_confirmation_token'
|
||||
]
|
||||
], $response->getErrors());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user