Changeset 32436
- Timestamp:
- 04/03/11 22:45:04 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.0/src/Symfony/Component/Console/Tester/CommandTester.php
r32226 r32436 47 47 * @param array $input An array of arguments and options 48 48 * @param array $options An array of options 49 * 50 * @return integer The command exit code 49 51 */ 50 52 public function execute(array $input, array $options = array()) … … 63 65 } 64 66 65 $ this->command->run($this->input, $this->output);67 $code = $this->command->run($this->input, $this->output); 66 68 67 69 rewind($this->output->getStream()); 68 70 69 return $this->display = stream_get_contents($this->output->getStream()); 71 $this->display = stream_get_contents($this->output->getStream()); 72 73 return $code; 70 74 } 71 75 branches/2.0/src/Symfony/Component/DomCrawler/Crawler.php
r32366 r32436 239 239 * Example: 240 240 * 241 * $crawler->filter('h1')->each(function ($ i, $node)241 * $crawler->filter('h1')->each(function ($node, $i) 242 242 * { 243 243 * return $node->nodeValue; branches/2.0/tests/Symfony/Tests/Component/Console/Command/CommandTest.php
r32226 r32436 206 206 } 207 207 208 $this->assertEquals('interact called'.PHP_EOL.'execute called'.PHP_EOL, $tester->execute(array(), array('interactive' => true)), '->run() calls the interact() method if the input is interactive'); 209 $this->assertEquals('execute called'.PHP_EOL, $tester->execute(array(), array('interactive' => false)), '->run() does not call the interact() method if the input is not interactive'); 208 $tester->execute(array(), array('interactive' => true)); 209 $this->assertEquals('interact called'.PHP_EOL.'execute called'.PHP_EOL, $tester->getDisplay(), '->run() calls the interact() method if the input is interactive'); 210 211 $tester->execute(array(), array('interactive' => false)); 212 $this->assertEquals('execute called'.PHP_EOL, $tester->getDisplay(), '->run() does not call the interact() method if the input is not interactive'); 210 213 211 214 $command = new Command('foo');