/** * @test */ public function importTemporaryFileFixesPermissionsForTemporaryFile() { $mockTempFile = vfsStream::newFile('SomeTemporaryFile', 0333)->withContent('fixture')->at($this->mockDirectory); $this->writableFileSystemStorage->_call('importTemporaryFile', $mockTempFile->url(), 'default'); // dummy assertion to suppress PHPUnit warning $this->assertTrue(TRUE); }
/** * @test */ public function importTemporaryFileSkipsFilesThatAlreadyExist() { $mockTempFile = vfsStream::newFile('SomeTemporaryFile', 0333)->withContent('fixture')->at($this->mockDirectory); $finalTargetPathAndFilename = $this->writableFileSystemStorage->_call('getStoragePathAndFilenameByHash', sha1('fixture')); Files::createDirectoryRecursively(dirname($finalTargetPathAndFilename)); file_put_contents($finalTargetPathAndFilename, 'existing file'); $this->writableFileSystemStorage->_call('importTemporaryFile', $mockTempFile->url(), 'default'); $this->assertSame('existing file', file_get_contents($finalTargetPathAndFilename)); }