Example #1
0
 /**
  * The post filter will replace all spaces with ':' 
  * @depends	testInterface
  * @return	null
  */
 public function estRunDispatchConsoleWithPreAndPostFilters()
 {
     $uriString = 'my-route/param1/value1';
     $output = $this->getMock('Appfuel\\Console\\ConsoleOutputInterface');
     $render = function ($data) {
         echo $data;
     };
     $filters = array('TestFuel\\Fake\\Action\\TestFront\\AddLabelFilter', 'TestFuel\\Fake\\Action\\TestFront\\PrependLabelFilter', 'TestFuel\\Fake\\Action\\TestFront\\ReplaceSpacesFilter');
     KernelRegistry::addParam('intercepting-filters', $filters);
     $output->expects($this->once())->method('render')->will($this->returnCallback($render));
     $result = $this->front->runConsoleUri($uriString, $output);
     $expected = '4:5:6:value:1:2:3:this:action:has:been:executed';
     $this->assertEquals(200, $result);
     $this->expectOutputString($expected);
 }