Mercurial > hg > isophonics-drupal-site
comparison core/modules/image/tests/src/Functional/FileMoveTest.php @ 18:af1871eacc83
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:33:08 +0100 |
parents | c2387f117808 |
children |
comparison
equal
deleted
inserted
replaced
17:129ea1e6d783 | 18:af1871eacc83 |
---|---|
1 <?php | 1 <?php |
2 | 2 |
3 namespace Drupal\Tests\image\Functional; | 3 namespace Drupal\Tests\image\Functional; |
4 | 4 |
5 use Drupal\Core\File\FileSystemInterface; | |
5 use Drupal\file\Entity\File; | 6 use Drupal\file\Entity\File; |
6 use Drupal\image\Entity\ImageStyle; | 7 use Drupal\image\Entity\ImageStyle; |
7 use Drupal\Tests\BrowserTestBase; | 8 use Drupal\Tests\BrowserTestBase; |
8 use Drupal\Tests\TestFileCreationTrait; | 9 use Drupal\Tests\TestFileCreationTrait; |
9 | 10 |
44 $this->assertTrue(file_exists($derivative_uri), 'Make sure derivative image is generated successfully.'); | 45 $this->assertTrue(file_exists($derivative_uri), 'Make sure derivative image is generated successfully.'); |
45 | 46 |
46 // Clone the object so we don't have to worry about the function changing | 47 // Clone the object so we don't have to worry about the function changing |
47 // our reference copy. | 48 // our reference copy. |
48 $desired_filepath = 'public://' . $this->randomMachineName(); | 49 $desired_filepath = 'public://' . $this->randomMachineName(); |
49 $result = file_move(clone $file, $desired_filepath, FILE_EXISTS_ERROR); | 50 $result = file_move(clone $file, $desired_filepath, FileSystemInterface::EXISTS_ERROR); |
50 | 51 |
51 // Check if image has been moved. | 52 // Check if image has been moved. |
52 $this->assertTrue(file_exists($result->getFileUri()), 'Make sure image is moved successfully.'); | 53 $this->assertTrue(file_exists($result->getFileUri()), 'Make sure image is moved successfully.'); |
53 | 54 |
54 // Check if derivative image has been flushed. | 55 // Check if derivative image has been flushed. |