mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
added after filter tests.
This commit is contained in:
parent
33e1bd4f11
commit
1264a7dd8d
@ -23,4 +23,26 @@ class RouteFilterTest extends PHPUnit_Framework_TestCase {
|
||||
$this->assertEquals(Filter::run(array('parameters:1,2'), array(3), true), '3|1|2');
|
||||
}
|
||||
|
||||
public function test_after_filters_are_called()
|
||||
{
|
||||
$filters = array(
|
||||
'after1' => function()
|
||||
{
|
||||
define('ROUTE_FILTER_AFTER_1', 1);
|
||||
},
|
||||
|
||||
'after2' => function()
|
||||
{
|
||||
define('ROUTE_FILTER_AFTER_2', 2);
|
||||
},
|
||||
);
|
||||
|
||||
Filter::register($filters);
|
||||
|
||||
Filter::run(array('after1', 'after2'));
|
||||
|
||||
$this->assertTrue(defined('ROUTE_FILTER_AFTER_1'));
|
||||
$this->assertTrue(defined('ROUTE_FILTER_AFTER_2'));
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user