Loading core/tests/Drupal/Tests/Core/Extension/DependencyTest.php +11 −3 Original line number Diff line number Diff line Loading @@ -52,11 +52,19 @@ public function testIsCompatible() { public function testSerialization() { $dependency = new Dependency('paragraphs_demo', 'paragraphs', '>8.x-1.1'); $this->assertTrue($dependency->isCompatible('1.2')); $this->assertInstanceOf(Constraint::class, $this->getObjectAttribute($dependency, 'constraint')); $reflected_constraint = (new \ReflectionObject($dependency))->getProperty('constraint'); $reflected_constraint->setAccessible(TRUE); $constraint = $reflected_constraint->getValue($dependency); $this->assertInstanceOf(Constraint::class, $constraint); $dependency = unserialize(serialize($dependency)); $this->assertNull($this->getObjectAttribute($dependency, 'constraint')); $reflected_constraint = (new \ReflectionObject($dependency))->getProperty('constraint'); $reflected_constraint->setAccessible(TRUE); $constraint = $reflected_constraint->getValue($dependency); $this->assertNull($constraint); $this->assertTrue($dependency->isCompatible('1.2')); $this->assertInstanceOf(Constraint::class, $this->getObjectAttribute($dependency, 'constraint')); $constraint = $reflected_constraint->getValue($dependency); $this->assertInstanceOf(Constraint::class, $constraint); } } core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php +3 −1 Original line number Diff line number Diff line Loading @@ -376,7 +376,9 @@ public function testSerialization() { $store = unserialize(serialize($this->tempStore)); $this->assertInstanceOf(SharedTempStore::class, $store); $request_stack = $this->getObjectAttribute($store, 'requestStack'); $reflected_request_stack = (new \ReflectionObject($store))->getProperty('requestStack'); $reflected_request_stack->setAccessible(TRUE); $request_stack = $reflected_request_stack->getValue($store); $this->assertEquals($this->requestStack, $request_stack); $this->assertSame($unserializable_request, $request_stack->pop()); } Loading core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ trait PHPUnit8Warnings { * @var string[] */ private static $ignoredWarnings = [ 'getObjectAttribute() is deprecated and will be removed in PHPUnit 9.', // Temporarily empty. ]; /** Loading Loading
core/tests/Drupal/Tests/Core/Extension/DependencyTest.php +11 −3 Original line number Diff line number Diff line Loading @@ -52,11 +52,19 @@ public function testIsCompatible() { public function testSerialization() { $dependency = new Dependency('paragraphs_demo', 'paragraphs', '>8.x-1.1'); $this->assertTrue($dependency->isCompatible('1.2')); $this->assertInstanceOf(Constraint::class, $this->getObjectAttribute($dependency, 'constraint')); $reflected_constraint = (new \ReflectionObject($dependency))->getProperty('constraint'); $reflected_constraint->setAccessible(TRUE); $constraint = $reflected_constraint->getValue($dependency); $this->assertInstanceOf(Constraint::class, $constraint); $dependency = unserialize(serialize($dependency)); $this->assertNull($this->getObjectAttribute($dependency, 'constraint')); $reflected_constraint = (new \ReflectionObject($dependency))->getProperty('constraint'); $reflected_constraint->setAccessible(TRUE); $constraint = $reflected_constraint->getValue($dependency); $this->assertNull($constraint); $this->assertTrue($dependency->isCompatible('1.2')); $this->assertInstanceOf(Constraint::class, $this->getObjectAttribute($dependency, 'constraint')); $constraint = $reflected_constraint->getValue($dependency); $this->assertInstanceOf(Constraint::class, $constraint); } }
core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php +3 −1 Original line number Diff line number Diff line Loading @@ -376,7 +376,9 @@ public function testSerialization() { $store = unserialize(serialize($this->tempStore)); $this->assertInstanceOf(SharedTempStore::class, $store); $request_stack = $this->getObjectAttribute($store, 'requestStack'); $reflected_request_stack = (new \ReflectionObject($store))->getProperty('requestStack'); $reflected_request_stack->setAccessible(TRUE); $request_stack = $reflected_request_stack->getValue($store); $this->assertEquals($this->requestStack, $request_stack); $this->assertSame($unserializable_request, $request_stack->pop()); } Loading
core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ trait PHPUnit8Warnings { * @var string[] */ private static $ignoredWarnings = [ 'getObjectAttribute() is deprecated and will be removed in PHPUnit 9.', // Temporarily empty. ]; /** Loading