Issue #3432849 by mondrake, Spokje: Method returnSelf() of class PHPUnit\Framework\TestCase is deprecated in PHPUnit 10

merge-requests/7163/head
catch 2024-03-22 14:19:54 +00:00
parent 82e373bff8
commit 63a572fc1e
6 changed files with 8 additions and 8 deletions

View File

@ -70,11 +70,11 @@ class CommentStatisticsUnitTest extends UnitTestCase {
$this->select->expects($this->any()) $this->select->expects($this->any())
->method('fields') ->method('fields')
->will($this->returnSelf()); ->willReturnSelf();
$this->select->expects($this->any()) $this->select->expects($this->any())
->method('condition') ->method('condition')
->will($this->returnSelf()); ->willReturnSelf();
$this->select->expects($this->any()) $this->select->expects($this->any())
->method('execute') ->method('execute')

View File

@ -255,7 +255,7 @@ class LocaleLookupTest extends UnitTestCase {
$string = $this->createMock('Drupal\locale\StringInterface'); $string = $this->createMock('Drupal\locale\StringInterface');
$string->expects($this->once()) $string->expects($this->once())
->method('addLocation') ->method('addLocation')
->will($this->returnSelf()); ->willReturnSelf();
$this->storage->expects($this->once()) $this->storage->expects($this->once())
->method('findTranslation') ->method('findTranslation')
->willReturn(NULL); ->willReturn(NULL);

View File

@ -36,7 +36,7 @@ class PerComponentEntityDisplayTest extends MigrateTestCase {
$entity->expects($this->once()) $entity->expects($this->once())
->method('setComponent') ->method('setComponent')
->with('field_name_test', ['test setting']) ->with('field_name_test', ['test setting'])
->will($this->returnSelf()); ->willReturnSelf();
$entity->expects($this->once()) $entity->expects($this->once())
->method('save') ->method('save')
->with(); ->with();

View File

@ -36,7 +36,7 @@ class PerComponentEntityFormDisplayTest extends MigrateTestCase {
$entity->expects($this->once()) $entity->expects($this->once())
->method('setComponent') ->method('setComponent')
->with('field_name_test', ['test setting']) ->with('field_name_test', ['test setting'])
->will($this->returnSelf()); ->willReturnSelf();
$entity->expects($this->once()) $entity->expects($this->once())
->method('save') ->method('save')
->with(); ->with();

View File

@ -47,7 +47,7 @@ class MakeUniqueEntityFieldTest extends MigrateProcessTestCase {
->getMock(); ->getMock();
$this->entityQuery->expects($this->any()) $this->entityQuery->expects($this->any())
->method('accessCheck') ->method('accessCheck')
->will($this->returnSelf()); ->willReturnSelf();
$this->entityTypeManager = $this->createMock(EntityTypeManagerInterface::class); $this->entityTypeManager = $this->createMock(EntityTypeManagerInterface::class);
$storage = $this->createMock(EntityStorageInterface::class); $storage = $this->createMock(EntityStorageInterface::class);

View File

@ -119,7 +119,7 @@ class StaticMenuLinkOverridesTest extends UnitTestCase {
->with('definitions', $this->callback(function (array $value) use (&$definitions): bool { ->with('definitions', $this->callback(function (array $value) use (&$definitions): bool {
return array_shift($definitions) === $value; return array_shift($definitions) === $value;
})) }))
->will($this->returnSelf()); ->willReturnSelf();
$config->expects($this->exactly(2)) $config->expects($this->exactly(2))
->method('save'); ->method('save');
@ -159,7 +159,7 @@ class StaticMenuLinkOverridesTest extends UnitTestCase {
$config->expects($old_definitions != $new_definitions ? $this->once() : $this->never()) $config->expects($old_definitions != $new_definitions ? $this->once() : $this->never())
->method('set') ->method('set')
->with('definitions', $new_definitions) ->with('definitions', $new_definitions)
->will($this->returnSelf()); ->willReturnSelf();
$config->expects($old_definitions != $new_definitions ? $this->once() : $this->never()) $config->expects($old_definitions != $new_definitions ? $this->once() : $this->never())
->method('save'); ->method('save');