Unverified Commit 5228b8df authored by Alex Pott's avatar Alex Pott
Browse files

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

parent 6108526c
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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));
  }

}
+0 −1
Original line number Diff line number Diff line
@@ -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.',