mirror of
https://github.com/flarum/framework.git
synced 2024-12-11 21:43:38 +08:00
Updated tests namespace to be ps4-valid. Added tests for flooding exception, fixed broken code
This commit is contained in:
parent
71bb3eadcd
commit
067f87eacb
|
@ -67,7 +67,7 @@
|
|||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"tests\\": "tests/"
|
||||
"Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
|
|
0
framework/core/phpunit.yml
Normal file
0
framework/core/phpunit.yml
Normal file
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace tests\Flarum\Admin\Middleware;
|
||||
namespace Tests\Flarum\Admin\Middleware;
|
||||
|
||||
use Flarum\Admin\Middleware\AuthenticateWithCookie;
|
||||
use Flarum\Admin\Middleware\RequireAdministrateAbility;
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace tests\Flarum\Core\Settings;
|
||||
namespace Tests\Flarum\Core\Settings;
|
||||
|
||||
use Flarum\Settings\DatabaseSettingsRepository;
|
||||
use Illuminate\Database\ConnectionInterface;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace tests\Flarum\Core\Settings;
|
||||
namespace Tests\Flarum\Core\Settings;
|
||||
|
||||
use Flarum\Settings\MemoryCacheSettingsRepository;
|
||||
use Flarum\Settings\SettingsRepositoryInterface;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace tests\Test;
|
||||
namespace Tests\Test;
|
||||
|
||||
use Mockery;
|
||||
use PHPUnit_Framework_TestCase;
|
||||
|
|
Loading…
Reference in New Issue
Block a user