diff --git a/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php b/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php index 5683676c03d..0e1d7809d85 100644 --- a/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php +++ b/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php @@ -70,11 +70,11 @@ class CommentStatisticsUnitTest extends UnitTestCase { $this->select->expects($this->any()) ->method('fields') - ->will($this->returnSelf()); + ->willReturnSelf(); $this->select->expects($this->any()) ->method('condition') - ->will($this->returnSelf()); + ->willReturnSelf(); $this->select->expects($this->any()) ->method('execute') diff --git a/core/modules/locale/tests/src/Unit/LocaleLookupTest.php b/core/modules/locale/tests/src/Unit/LocaleLookupTest.php index 1a01ed15981..9095f3664ea 100644 --- a/core/modules/locale/tests/src/Unit/LocaleLookupTest.php +++ b/core/modules/locale/tests/src/Unit/LocaleLookupTest.php @@ -255,7 +255,7 @@ class LocaleLookupTest extends UnitTestCase { $string = $this->createMock('Drupal\locale\StringInterface'); $string->expects($this->once()) ->method('addLocation') - ->will($this->returnSelf()); + ->willReturnSelf(); $this->storage->expects($this->once()) ->method('findTranslation') ->willReturn(NULL); diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php index 60f0a7a3dd5..159a6d41d93 100644 --- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php +++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php @@ -36,7 +36,7 @@ class PerComponentEntityDisplayTest extends MigrateTestCase { $entity->expects($this->once()) ->method('setComponent') ->with('field_name_test', ['test setting']) - ->will($this->returnSelf()); + ->willReturnSelf(); $entity->expects($this->once()) ->method('save') ->with(); diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php index be6b38b0714..b93500261b2 100644 --- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php +++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php @@ -36,7 +36,7 @@ class PerComponentEntityFormDisplayTest extends MigrateTestCase { $entity->expects($this->once()) ->method('setComponent') ->with('field_name_test', ['test setting']) - ->will($this->returnSelf()); + ->willReturnSelf(); $entity->expects($this->once()) ->method('save') ->with(); diff --git a/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php b/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php index c73abd63812..47f03d2aaa8 100644 --- a/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php +++ b/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php @@ -47,7 +47,7 @@ class MakeUniqueEntityFieldTest extends MigrateProcessTestCase { ->getMock(); $this->entityQuery->expects($this->any()) ->method('accessCheck') - ->will($this->returnSelf()); + ->willReturnSelf(); $this->entityTypeManager = $this->createMock(EntityTypeManagerInterface::class); $storage = $this->createMock(EntityStorageInterface::class); diff --git a/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php b/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php index bd6944b62e3..7e5acedecc6 100644 --- a/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php +++ b/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php @@ -119,7 +119,7 @@ class StaticMenuLinkOverridesTest extends UnitTestCase { ->with('definitions', $this->callback(function (array $value) use (&$definitions): bool { return array_shift($definitions) === $value; })) - ->will($this->returnSelf()); + ->willReturnSelf(); $config->expects($this->exactly(2)) ->method('save'); @@ -159,7 +159,7 @@ class StaticMenuLinkOverridesTest extends UnitTestCase { $config->expects($old_definitions != $new_definitions ? $this->once() : $this->never()) ->method('set') ->with('definitions', $new_definitions) - ->will($this->returnSelf()); + ->willReturnSelf(); $config->expects($old_definitions != $new_definitions ? $this->once() : $this->never()) ->method('save');