public function FileSystemTest::testUnlink in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/File/FileSystemTest.php \Drupal\Tests\Core\File\FileSystemTest::testUnlink()
- 10 core/tests/Drupal/Tests/Core/File/FileSystemTest.php \Drupal\Tests\Core\File\FileSystemTest::testUnlink()
@covers ::unlink
File
- core/
tests/ Drupal/ Tests/ Core/ File/ FileSystemTest.php, line 91
Class
- FileSystemTest
- @coversDefaultClass \Drupal\Core\File\FileSystem
Namespace
Drupal\Tests\Core\FileCode
public function testUnlink() {
vfsStream::setup('dir');
vfsStream::create([
'test.txt' => 'asdf',
]);
$uri = 'vfs://dir/test.txt';
$this->streamWrapperManager
->expects($this
->once())
->method('isValidUri')
->willReturn(TRUE);
$this
->assertFileExists($uri);
$this->fileSystem
->unlink($uri);
$this
->assertFileDoesNotExist($uri);
}