Unverified Commit 076d6f45 authored by alexpott's avatar alexpott
Browse files

Issue #3126970 by mondrake, longwave: Replace usage of readAttribute() that is deprecated

(cherry picked from commit c0f2b559)
parent 50a60755
......@@ -23,7 +23,9 @@ class FilterFormatPermissionTest extends MigrateDrupalTestBase {
public function testConfigurableFilterFormat() {
$migration = Migration::create($this->container, [], 'custom_migration', []);
$filterFormatPermissionMigration = FilterFormatPermission::create($this->container, ['migration' => 'custom_filter_format'], 'custom_filter_format', [], $migration);
$config = $this->readAttribute($filterFormatPermissionMigration, 'configuration');
$reflected_config = new \ReflectionProperty($filterFormatPermissionMigration, 'configuration');
$reflected_config->setAccessible(TRUE);
$config = $reflected_config->getValue($filterFormatPermissionMigration);
$this->assertEquals($config['migration'], 'custom_filter_format');
}
......
......@@ -53,7 +53,9 @@ public function testServiceAppRouteUsage() {
// Instantiate an Extension object for testing unserialization.
$extension = new Extension($container->getParameter('app.root'), 'module', 'core/modules/system/system.info.yml', 'system.module');
$extension = unserialize(serialize($extension));
$this->assertEquals('vfs://dummy_app_root', $this->readAttribute($extension, 'root'));
$reflected_root = new \ReflectionProperty($extension, 'root');
$reflected_root->setAccessible(TRUE);
$this->assertEquals('vfs://dummy_app_root', $reflected_root->getValue($extension));
}
/**
......
......@@ -25,7 +25,9 @@ public function testSymfonyGuesserRegistration() {
// Test that the Drupal mime type guess is not being used before the
// override method is called. It is possible that the test environment does
// not support the default guessers.
$guessers = $this->readAttribute($symfony_guesser, 'guessers');
$reflected_guessers = new \ReflectionProperty($symfony_guesser, 'guessers');
$reflected_guessers->setAccessible(TRUE);
$guessers = $reflected_guessers->getValue($symfony_guesser);
if (count($guessers)) {
$this->assertNotInstanceOf('Drupal\Core\File\MimeType\MimeTypeGuesser', $guessers[0]);
}
......@@ -33,7 +35,7 @@ public function testSymfonyGuesserRegistration() {
$container->set('file.mime_type.guesser', new MimeTypeGuesser(new StreamWrapperManager()));
MimeTypeGuesser::registerWithSymfonyGuesser($container);
$symfony_guesser = SymfonyMimeTypeGuesser::getInstance();
$guessers = $this->readAttribute($symfony_guesser, 'guessers');
$guessers = $reflected_guessers->getValue($symfony_guesser);
$this->assertSame($container->get('file.mime_type.guesser'), $guessers[0]);
$this->assertInstanceOf('Drupal\Core\File\MimeType\MimeTypeGuesser', $guessers[0]);
$count = count($guessers);
......@@ -42,7 +44,7 @@ public function testSymfonyGuesserRegistration() {
$container->set('file.mime_type.guesser', new MimeTypeGuesser(new StreamWrapperManager()));
MimeTypeGuesser::registerWithSymfonyGuesser($container);
$symfony_guesser = SymfonyMimeTypeGuesser::getInstance();
$guessers = $this->readAttribute($symfony_guesser, 'guessers');
$guessers = $reflected_guessers->getValue($symfony_guesser);
$this->assertSame($container->get('file.mime_type.guesser'), $guessers[0]);
$this->assertInstanceOf('Drupal\Core\File\MimeType\MimeTypeGuesser', $guessers[0]);
$new_count = count($guessers);
......
......@@ -23,7 +23,6 @@ trait PHPUnit8Warnings {
* @var string[]
*/
private static $ignoredWarnings = [
'readAttribute() is deprecated and will be removed in PHPUnit 9.',
'getObjectAttribute() is deprecated and will be removed in PHPUnit 9.',
];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment