5 require_once(
'./vendor/composer/vendor/autoload.php');
    36     protected function setUp(): void
    50         $metadata = 
new Metadata(
'test.txt', 4500, 
'text/plain');
    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);
    67         $result = $this->subject->process($stream, $metadata);
    70         $this->assertSame(
'All green!', $result->getMessage());
    79         $expectedResponse = 
new ProcessingStatus(
ProcessingStatus::OK, 
'No processors were registered.');
    80         $metadata = 
new Metadata(
'test.txt', 4500, 
'text/plain');
    82         $stream = Mockery::mock(FileStream::class);
    84         $result = $this->subject->process($stream, $metadata);
    86         $this->assertSame($expectedResponse->getCode(), $result->getCode());
    87         $this->assertSame($expectedResponse->getMessage(), $result->getMessage());
    99         $metadata = 
new Metadata(
'test.txt', 4500, 
'text/plain');
   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);
   116         $result = $this->subject->process($stream, $metadata);
   118         $this->assertSame($responseBad->getCode(), $result->getCode());
   119         $this->assertSame($responseBad->getMessage(), $result->getMessage());
   130         $metadata = 
new Metadata(
'test.txt', 4500, 
'text/plain');
   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);
   152         $result = $this->subject->process($stream, $metadata);
   155         $this->assertSame(
'Processor failed with exception message "Bad stuff happened!"', $result->getMessage());
 const REJECTED
Upload got rejected by a processor. 
 
testProcessValidFileWithFailingProcessorWhichShouldGetRejected()
 
testProcessWithoutProcessorsWhichShouldSucceed()
 
testProcessValidFileWhichShouldSucceed()
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
Class PreProcessorManagerImpl. 
 
testProcessInvalidFileWhichShouldGetRejected()
 
Class PreProcessorManagerImplTest.