Plum\Plum\WorkflowTest::processShouldApplyConverterToReadItems PHP Method

processShouldApplyConverterToReadItems() public method

    public function processShouldApplyConverterToReadItems()
    {
        $iterator = m::mock('\\Iterator');
        $iterator->shouldReceive('rewind');
        $iterator->shouldReceive('valid')->andReturn(true)->once();
        $iterator->shouldReceive('current')->andReturn('foobar');
        $iterator->shouldReceive('next');
        $iterator->shouldReceive('valid')->andReturn(false)->once();
        $reader = $this->getMockReader();
        $reader->shouldReceive('getIterator')->andReturn($iterator);
        $converter = $this->getMockConverter();
        $converter->shouldReceive('convert')->with('foobar')->once()->andReturn('FOOBAR');
        $this->workflow->addConverter($converter);
        $result = $this->workflow->process($reader);
        $this->assertEquals(1, $result->getReadCount());
    }
WorkflowTest