+ public function testExceptionWhenStoreTempFails() {
+ $mockRepoStoreStatusResult = Status::newFatal( 'TEST_ERROR' );
+ $mockRepo = $this->getMockBuilder( FileRepo::class )
+ ->disableOriginalConstructor()
+ ->getMock();
+ $mockRepo->expects( $this->once() )
+ ->method( 'storeTemp' )
+ ->willReturn( $mockRepoStoreStatusResult );
+
+ $stash = new UploadStash( $mockRepo );
+ try {
+ $stash->stashFile( $this->tmpFile );
+ $this->fail( 'Expected UploadStashFileException not thrown' );
+ } catch ( UploadStashFileException $e ) {
+ $this->assertInstanceOf( ILocalizedException::class, $e );
+ } catch ( Exception $e ) {
+ $this->fail( 'Unexpected exception class ' . get_class( $e ) );
+ }
+ }