Unverified Commit 75acedef authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3162008 by catch, mikelutz, Hardik_Patel_12, longwave: Prepare for...

Issue #3162008 by catch, mikelutz, Hardik_Patel_12, longwave: Prepare for EventDispatcherInterface::dispatch() return type hint
parent 1e5b9c76
Loading
Loading
Loading
Loading
+2 −2
Changes for core/modules/layout_builder/tests/src/Unit/SectionComponentTest.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
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 @@ public function testToRenderArray() {
        /** @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);
+4 −0
Changes for core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@
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 @@ public function testId() {
  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());