public function testAll() { $iterator1 = $this->createMock(ScheduleIteratorInterface::class); $iterator2 = $this->createMock(ScheduleIteratorInterface::class); $this->subject->register('foo', $iterator1); $this->subject->register('bar', $iterator2); $this->assertEquals(['foo' => $iterator1, 'bar' => $iterator2], $this->subject->all()); }
public function testExecuteProcessesHandlesException() { $this->registry->register('foo', $this->buildIterator(2)); $this->scheduler->expects($this->any())->method('process')->will($this->throwException(new \Exception())); $input = array('--iteration' => 1); $command = $this->application->find('abc:scheduler:process'); $commandTester = new CommandTester($command); $commandTester->execute($input); }