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())
->method('fields')
->will($this->returnSelf());
->willReturnSelf();
$this->select->expects($this->any())
->method('condition')
->will($this->returnSelf());
->willReturnSelf();
$this->select->expects($this->any())
->method('execute')

View File

@ -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);

View File

@ -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();

View File

@ -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();

View File

@ -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);

View File

@ -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');