Unverified Commit 38f08f8b authored by alexpott's avatar alexpott
Browse files

Issue #3126792 by mondrake: Replace usage of assertAttributeSame() that is deprecated

(cherry picked from commit 5228b8df)
parent e89ebbda
......@@ -28,6 +28,9 @@ public function testDiscoverServiceCustom() {
$kernel = new DrupalKernel('prod', new ClassLoader());
$kernel->discoverServiceProviders();
$reflected_yamls = (new \ReflectionObject($kernel))->getProperty('serviceYamls');
$reflected_yamls->setAccessible(TRUE);
$expect = [
'app' => [
'core' => 'core/core.services.yml',
......@@ -36,8 +39,7 @@ public function testDiscoverServiceCustom() {
__DIR__ . '/fixtures/custom.yml',
],
];
$this->assertAttributeSame($expect, 'serviceYamls', $kernel);
$this->assertSame($expect, $reflected_yamls->getValue($kernel));
}
/**
......@@ -48,13 +50,16 @@ public function testDiscoverServiceNoContainerYamls() {
$kernel = new DrupalKernel('prod', new ClassLoader());
$kernel->discoverServiceProviders();
$reflected_yamls = (new \ReflectionObject($kernel))->getProperty('serviceYamls');
$reflected_yamls->setAccessible(TRUE);
$expect = [
'app' => [
'core' => 'core/core.services.yml',
],
'site' => [],
];
$this->assertAttributeSame($expect, 'serviceYamls', $kernel);
$this->assertSame($expect, $reflected_yamls->getValue($kernel));
}
}
......@@ -27,7 +27,6 @@ trait PHPUnit8Warnings {
'readAttribute() is deprecated and will be removed in PHPUnit 9.',
'getObjectAttribute() is deprecated and will be removed in PHPUnit 9.',
'assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.',
'assertAttributeSame() is deprecated and will be removed in PHPUnit 9.',
'assertAttributeInstanceOf() is deprecated and will be removed in PHPUnit 9.',
'assertAttributeEmpty() is deprecated and will be removed in PHPUnit 9.',
'The optional $ignoreCase parameter of assertContains() 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