RouteFilterTest.php 510 B

12345678910111213141516171819202122232425
  1. <?php use Laravel\Routing\Filter;
  2. class RouteFilterTest extends PHPUnit_Framework_TestCase {
  3. public function test_simple_filters_can_be_called()
  4. {
  5. $filters = array(
  6. 'simple' => function()
  7. {
  8. return 'simple';
  9. },
  10. 'parameters' => function($one, $two)
  11. {
  12. return $one.'|'.$two;
  13. },
  14. );
  15. Filter::register($filters);
  16. $this->assertEquals(Filter::run(array('simple'), array(), true), 'simple');
  17. $this->assertEquals(Filter::run(array('parameters:1,2'), array(), true), '1|2');
  18. }
  19. }