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