Skip to content
Snippets Groups Projects
Commit 66178ce6 authored by Marcin Grabias's avatar Marcin Grabias Committed by Tim Diels
Browse files

Reverted some unintended changes.

parent 2a56da14
No related branches found
No related tags found
No related merge requests found
Pipeline #476658 passed
Pipeline: drupal-3343670

#476665

    ......@@ -5,12 +5,12 @@
    namespace Drupal\Tests\Core\Ajax;
    use Drupal\Core\Ajax\AjaxResponse;
    use Drupal\Core\Ajax\CommandInterface;
    use Drupal\Core\EventSubscriber\AjaxResponseSubscriber;
    use Drupal\Tests\UnitTestCase;
    use Symfony\Component\HttpFoundation\Request;
    use Symfony\Component\HttpKernel\Event\ResponseEvent;
    use Symfony\Component\HttpKernel\HttpKernelInterface;
    use PHPUnit\Framework\MockObject\MockObject;
    /**
    * @coversDefaultClass \Drupal\Core\Ajax\AjaxResponse
    ......@@ -109,10 +109,7 @@ public function testPrepareResponseForIeFormRequestsWithFileUpload(): void {
    public function testMergeWithOtherAjaxResponse(): void {
    $response = new AjaxResponse([]);
    $command_one = $this->createMock('Drupal\Core\Ajax\CommandInterface');
    $command_one->expects($this->once())
    ->method('render')
    ->willReturn(['command' => 'one']);
    $command_one = $this->createCommandMock('one');
    $command_two = $this->createCommandMockWithSettingsAndLibrariesAttachments(
    'Drupal\Core\Ajax\HtmlCommand', [
    ......@@ -154,7 +151,7 @@ private function createCommandMockWithSettingsAndLibrariesAttachments(
    array|null $settings,
    array|null $libraries,
    string $command_name,
    ): MockObject {
    ): CommandInterface {
    $command = $this->createMock($command_class_name);
    $command->expects($this->once())
    ->method('render')
    ......@@ -169,4 +166,18 @@ private function createCommandMockWithSettingsAndLibrariesAttachments(
    return $command;
    }
    /**
    * Creates a mock of the Drupal\Core\Ajax\CommandInterface.
    *
    * @throws \PHPUnit\Framework\MockObject\Exception
    */
    private function createCommandMock(string $command_name): CommandInterface {
    $command = $this->createMock('Drupal\Core\Ajax\CommandInterface');
    $command->expects($this->once())
    ->method('render')
    ->willReturn(['command' => $command_name]);
    return $command;
    }
    }
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment