5require_once(
'./libs/composer/vendor/autoload.php');
 
   11use PHPUnit\Framework\TestCase;
 
   25    use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
 
   52        $processor = Mockery::mock(PreProcessor::class);
 
   53        $processor->shouldReceive(
'process')
 
   58        $stream = Mockery::mock(FileStream::class);
 
   59        $stream->shouldReceive(
'rewind')
 
   63        $this->subject->with($processor);
 
   64        $this->subject->with($processor);
 
   65        $this->subject->with($processor);
 
   70        $this->assertSame(
'All green!', 
$result->getMessage());
 
   82        $stream = Mockery::mock(FileStream::class);
 
   86        $this->assertSame($expectedResponse->getCode(), 
$result->getCode());
 
   87        $this->assertSame($expectedResponse->getMessage(), 
$result->getMessage());
 
  101        $processor = Mockery::mock(PreProcessor::class);
 
  102        $processor->shouldReceive(
'process')
 
  105            ->andReturnValues([$responseGood, $responseBad, $responseGood]);
 
  107        $stream = Mockery::mock(FileStream::class);
 
  108        $stream->shouldReceive(
'rewind')
 
  112        $this->subject->with($processor);
 
  113        $this->subject->with($processor);
 
  114        $this->subject->with($processor);
 
  118        $this->assertSame($responseBad->getCode(), 
$result->getCode());
 
  119        $this->assertSame($responseBad->getMessage(), 
$result->getMessage());
 
  132        $processor = Mockery::mock(PreProcessor::class);
 
  133        $processor->shouldReceive(
'process')
 
  136            ->andReturn($responseGood);
 
  138        $processor->shouldReceive(
'process')
 
  141            ->andThrow(\RuntimeException::class, 
'Bad stuff happened!');
 
  143        $stream = Mockery::mock(FileStream::class);
 
  144        $stream->shouldReceive(
'rewind')
 
  148        $this->subject->with($processor);
 
  149        $this->subject->with($processor);
 
  150        $this->subject->with($processor);
 
  155        $this->assertSame(
'Processor failed with exception message "Bad stuff happened!"', 
$result->getMessage());
 
$metadata['__DYNAMIC:1__']
An exception for terminatinating execution or to throw for unit testing.
const REJECTED
Upload got rejected by a processor.
Class PreProcessorManagerImplTest.
testProcessValidFileWhichShouldSucceed()
@Test @small
testProcessWithoutProcessorsWhichShouldSucceed()
@Test @small
testProcessValidFileWithFailingProcessorWhichShouldGetRejected()
@Test @small
testProcessInvalidFileWhichShouldGetRejected()
@Test @small
Class PreProcessorManagerImpl.
$stream
PHP stream implementation.