I am trying to call 'router:debug' Command from within a WebTestCase to validate all static routes automatically.
class RoutesTest extends WebTestCase
{
public function setUp()
{
$command = self::getApplication()->find('router:debug');
$input = new ArrayInput(array());
$returnCode = $command->run($input, $output);
if($returnCode == 0) {
var_dump($output);
}
}
}
But I get a
PHP Fatal error: Call to undefined method MyApplication\MyBundle\Tests\Controller\RoutesTest::getApplication() in /data/www/symfony/src/Prexem/UserBundle/Tests/Controller/DefaultControllerTest.php