public function testFireCallsSeederWithProperConnectionAndPathWhenConnectionIsSpecified() { $events = m::mock('Illuminate\\Events\\Dispatcher'); $events->shouldReceive('listen')->once()->with('illuminate.seeding', m::type('Closure')); $command = new SeedCommand($resolver = m::mock('Illuminate\\Database\\ConnectionResolverInterface'), $seeder = m::mock('Illuminate\\Database\\Seeder'), $events, 'path'); $connection = m::mock('Illuminate\\Database\\Connection'); $resolver->shouldReceive('connection')->once()->with('foo')->andReturn($connection); $seeder->shouldReceive('seed')->once()->with($connection, 'path'); $command->run(new Symfony\Component\Console\Input\ArrayInput(array('--database' => 'foo')), new Symfony\Component\Console\Output\NullOutput()); }
/** * Get the console command options. * * @return array */ protected function getOptions() { return array_merge(array(array('country', null, InputOption::VALUE_REQUIRED, 'Seed a specific country instead.'), array('path', null, InputOption::VALUE_REQUIRED, 'Path where files are located.')), parent::getOptions()); }