Plum\Plum\WorkflowTest::processShouldThrowExceptionsIfResumeOnErrorOptionIsFalse PHP Method

processShouldThrowExceptionsIfResumeOnErrorOptionIsFalse() public method

    public function processShouldThrowExceptionsIfResumeOnErrorOptionIsFalse()
    {
        $iterator = m::mock('\\Iterator');
        $iterator->shouldReceive('rewind');
        $iterator->shouldReceive('valid')->andReturn(true)->once();
        $iterator->shouldReceive('current')->andReturn('foobar');
        $iterator->shouldReceive('next');
        $reader = $this->getMockReader();
        $reader->shouldReceive('getIterator')->andReturn($iterator);
        $converter = $this->getMockConverter();
        $converter->shouldReceive('convert')->with('foobar')->once()->andThrow(new Exception());
        $workflow = new Workflow(['resumeOnError' => false]);
        $workflow->addConverter($converter);
        $workflow->process($reader);
    }
WorkflowTest