You are here

public function FileSyncTest::testDeleteFile in Tome 8

@covers \Drupal\tome_sync\FileSync::deleteFile

File

modules/tome_sync/tests/src/Kernel/FileSyncTest.php, line 67

Class

FileSyncTest
Tests that the file sync works.

Namespace

Drupal\Tests\tome_sync\Kernel

Code

public function testDeleteFile() {
  $directory = Settings::get('tome_files_directory') . '/public';
  $this->fileSystem
    ->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY);
  touch($directory . '/example.txt');
  \Drupal::service('tome_sync.file_sync')
    ->deleteFile('example.txt');
  $this
    ->assertFalse(file_exists($directory . '/example.txt'));
}