You are here

public function FileSyncTest::testDeleteFileExport in Tome 8

@covers \Drupal\tome_sync\FileSync::deleteFileExport

File

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

Class

FileSyncTest
Tests that the file sync works.

Namespace

Drupal\Tests\tome_sync\Kernel

Code

public function testDeleteFileExport() {
  touch('public://example.txt');
  $file = File::create([
    'uri' => 'public://example.txt',
  ]);
  $file
    ->save();
  $this
    ->assertTrue(file_exists(Settings::get('tome_files_directory') . '/public/example.txt'));
  $file
    ->delete();
  $this
    ->assertFalse(file_exists(Settings::get('tome_files_directory') . '/public/example.txt'));
}