Source of file GroupedProcessorTest.php
Size: 1,557 Bytes - Last Modified: 2021-12-24T06:51:36+00:00
/var/www/docs.ssmods.com/process/src/tests/Output/GroupedProcessorTest.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | <?php namespace Heystack\Core\Output; class GroupedProcessorTest extends \PHPUnit_Framework_TestCase { public $groupedProcessor; protected function setUp() { $this->groupedProcessor = new GroupedProcessor('test'); } protected function tearDown() { $this->groupedProcessor = null; } public function testProcess() { $this->assertEquals('test', $this->groupedProcessor->getIdentifier()->getFull()); $this->groupedProcessor->setProcessors( [ $this->getProcessorStub('test_output_processor'), $this->getProcessorStub('test_output_processor2', 'sweet'), $this->getProcessorStub('test_output_processor3', 'working') ] ); $this->assertEquals(null, $this->groupedProcessor->process(new \Controller())); } protected function getProcessorStub($identifier, $process = null) { $identifierStub = $this->getMock('Heystack\Core\Identifier\IdentifierInterface'); $identifierStub->expects($this->any()) ->method('getFull') ->will($this->returnValue($identifier)); $processorStub = $this->getMock('Heystack\Core\Output\ProcessorInterface'); $processorStub->expects($this->any()) ->method('getIdentifier') ->will($this->returnValue($identifierStub)); $processorStub->expects($this->any()) ->method('process') ->will($this->returnValue($process)); return $processorStub; } } |