comparison core/tests/Drupal/Tests/BrowserTestBase.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
413 // can be marked as risky. 413 // can be marked as risky.
414 $this->addToAssertionCount(1); 414 $this->addToAssertionCount(1);
415 } 415 }
416 416
417 /** 417 /**
418 * Ensures test files are deletable within file_unmanaged_delete_recursive(). 418 * Ensures test files are deletable.
419 * 419 *
420 * Some tests chmod generated files to be read only. During 420 * Some tests chmod generated files to be read only. During
421 * BrowserTestBase::cleanupEnvironment() and other cleanup operations, 421 * BrowserTestBase::cleanupEnvironment() and other cleanup operations,
422 * these files need to get deleted too. 422 * these files need to get deleted too.
423 * 423 *
424 * @param string $path 424 * @param string $path
425 * The file path. 425 * The file path.
426 *
427 * @see \Drupal\Core\File\FileSystemInterface::deleteRecursive()
426 */ 428 */
427 public static function filePreDeleteCallback($path) { 429 public static function filePreDeleteCallback($path) {
428 // When the webserver runs with the same system user as phpunit, we can 430 // When the webserver runs with the same system user as phpunit, we can
429 // make read-only files writable again. If not, chmod will fail while the 431 // make read-only files writable again. If not, chmod will fail while the
430 // file deletion still works if file permissions have been configured 432 // file deletion still works if file permissions have been configured
449 } 451 }
450 } 452 }
451 } 453 }
452 454
453 // Delete test site directory. 455 // Delete test site directory.
454 file_unmanaged_delete_recursive($this->siteDirectory, [$this, 'filePreDeleteCallback']); 456 \Drupal::service('file_system')->deleteRecursive($this->siteDirectory, [$this, 'filePreDeleteCallback']);
455 } 457 }
456 458
457 /** 459 /**
458 * {@inheritdoc} 460 * {@inheritdoc}
459 */ 461 */