diff --git a/core/modules/contact/tests/src/Unit/MailHandlerTest.php b/core/modules/contact/tests/src/Unit/MailHandlerTest.php index 439e5077bf..78ace85b91 100644 --- a/core/modules/contact/tests/src/Unit/MailHandlerTest.php +++ b/core/modules/contact/tests/src/Unit/MailHandlerTest.php @@ -9,6 +9,7 @@ use Drupal\Core\Language\Language; use Drupal\Core\Session\AccountInterface; use Drupal\Tests\UnitTestCase; +use Drupal\user\Entity\User; /** * @coversDefaultClass \Drupal\contact\MailHandler @@ -292,7 +293,7 @@ public function getSendMailMessages() { * Mock sender for testing. */ protected function getMockSender($anonymous = TRUE, $mail_address = 'anonymous@drupal.org') { - $sender = $this->createMock('\Drupal\Core\Session\AccountInterface'); + $sender = $this->createMock(User::class); $sender->expects($this->once()) ->method('isAnonymous') ->willReturn($anonymous); diff --git a/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php b/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php index 0560901888..c20cfe45a4 100644 --- a/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php +++ b/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php @@ -168,7 +168,7 @@ public function testGet() { $this->assertEquals($some_parameter, $service->getSomeParameter(), '%some_config% was injected via constructor.'); $this->assertEquals($this->container, $service->getContainer(), 'Container was injected via setter injection.'); $this->assertEquals($some_other_parameter, $service->getSomeOtherParameter(), '%some_other_config% was injected via setter injection.'); - $this->assertEquals('foo', $service->_someProperty, 'Service has added properties.'); + $this->assertEquals('foo', $service->someProperty, 'Service has added properties.'); } /** @@ -741,7 +741,7 @@ protected function getMockContainerDefinition() { $this->getServiceCall('other.service'), $this->getParameterCall('some_config'), ]), - 'properties' => $this->getCollection(['_someProperty' => 'foo']), + 'properties' => $this->getCollection(['someProperty' => 'foo']), 'calls' => [ [ 'setContainer', @@ -1106,6 +1106,11 @@ class MockService { */ protected $someOtherParameter; + /** + * @var string + */ + public $someProperty; + /** * Constructs a MockService object. * diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php index 9c160facbc..f2de6017ad 100644 --- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php @@ -514,6 +514,7 @@ public function testSort() { ->will($this->returnValue([ 'entity_keys' => [ 'label' => 'label', + 'weight' => 'weight', ], ])); diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php index 20624988f8..8994e06f6c 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\Core\Entity; +use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Language\Language; @@ -93,7 +94,7 @@ public function testToLink($entity_label, $link_text, $expected_text, $link_rel ->will($this->returnValue($entity_type)); /** @var \Drupal\Core\Entity\Entity $entity */ - $entity = $this->getMockForAbstractClass('Drupal\Core\Entity\EntityBase', [ + $entity = $this->getMockForAbstractClass(ConfigEntityBase::class, [ ['id' => $entity_id, 'label' => $entity_label, 'langcode' => 'es'], $entity_type_id, ]);