mirror of
https://github.com/flarum/core.git
synced 2025-07-30 21:20:24 +02:00
Updated tests namespace to be ps4-valid. Added tests for flooding exception, fixed broken code
This commit is contained in:
22
tests/Flarum/Api/Handler/FloodingExceptionHandlerTest.php
Normal file
22
tests/Flarum/Api/Handler/FloodingExceptionHandlerTest.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace tests\Flarum\Api\Handler;
|
||||
|
||||
use Flarum\Api\Handler\FloodingExceptionHandler;
|
||||
use Flarum\Core\Exception\FloodingException;
|
||||
use Tests\Test\TestCase;
|
||||
|
||||
class FloodingExceptionHandlerTest extends TestCase
|
||||
{
|
||||
private $handler;
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->handler = new FloodingExceptionHandler;
|
||||
}
|
||||
|
||||
public function test_it_handles_recognisable_exceptions()
|
||||
{
|
||||
$this->assertFalse($this->handler->manages(new \Exception));
|
||||
$this->assertTrue($this->handler->manages(new FloodingException));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user