diff --git a/core/modules/layout_builder/tests/src/Unit/SectionComponentTest.php b/core/modules/layout_builder/tests/src/Unit/SectionComponentTest.php index ca2138ec9ee7..e50fe65e3586 100644 --- a/core/modules/layout_builder/tests/src/Unit/SectionComponentTest.php +++ b/core/modules/layout_builder/tests/src/Unit/SectionComponentTest.php @@ -12,7 +12,7 @@ use Drupal\layout_builder\LayoutBuilderEvents; use Drupal\layout_builder\SectionComponent; use Drupal\Tests\UnitTestCase; use Prophecy\Argument; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; /** * @coversDefaultClass \Drupal\layout_builder\SectionComponent @@ -39,7 +39,7 @@ class SectionComponentTest extends UnitTestCase { /** @var \Drupal\layout_builder\Event\SectionComponentBuildRenderArrayEvent $event */ $event = $args[0]; $event->setBuild(['#markup' => $event->getPlugin()->getPluginId()]); - return; + return $event; }); $layout_plugin = $this->prophesize(LayoutInterface::class); diff --git a/core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php b/core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php index ae233a5cb918..33f9323bbafc 100644 --- a/core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php +++ b/core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php @@ -5,6 +5,8 @@ namespace Drupal\Tests\Core\Session; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\AccountProxy; use Drupal\Tests\UnitTestCase; +use Prophecy\Argument; +use Symfony\Contracts\EventDispatcher\Event; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** @@ -19,6 +21,7 @@ class AccountProxyTest extends UnitTestCase { */ public function testId() { $dispatcher = $this->prophesize(EventDispatcherInterface::class); + $dispatcher->dispatch(Argument::any(), Argument::any())->willReturn(new Event()); $account_proxy = new AccountProxy($dispatcher->reveal()); $this->assertSame(0, $account_proxy->id()); $account_proxy->setInitialAccountId(1); @@ -39,6 +42,7 @@ class AccountProxyTest extends UnitTestCase { public function testSetInitialAccountIdException() { $this->expectException(\LogicException::class); $dispatcher = $this->prophesize(EventDispatcherInterface::class); + $dispatcher->dispatch(Argument::any(), Argument::any())->willReturn(new Event()); $account_proxy = new AccountProxy($dispatcher->reveal()); $current_user = $this->prophesize(AccountInterface::class); $account_proxy->setAccount($current_user->reveal());