Created
November 4, 2013 16:51
-
-
Save ipalaus/7305578 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -15,7 +15,11 @@ class DatabaseSeederTest extends PHPUnit_Framework_TestCase { | |
{ | |
$seeder = new Seeder; | |
$seeder->setContainer($container = m::mock('Illuminate\Container\Container')); | |
- $seeder->setCommand($command = m::mock('Illuminate\Console\Command')); | |
+ $output = m::mock('Symfony\Component\Console\Output\OutputInterface'); | |
+ $output->shouldReceive('writeln')->once()->andReturn('foo'); | |
+ $command = m::mock('Illuminate\Console\Command'); | |
+ $command->shouldReceive('getOutput')->once()->andReturn($output); | |
+ $seeder->setCommand($command); | |
$container->shouldReceive('make')->once()->with('ClassName')->andReturn($child = m::mock('StdClass')); | |
$child->shouldReceive('setContainer')->once()->with($container)->andReturn($child); | |
$child->shouldReceive('setCommand')->once()->with($command)->andReturn($child); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment