function MediaLibraryStateTest::testFromRequestQueryLess

Same name and namespace in other branches
  1. 9 core/modules/media_library/tests/src/Kernel/MediaLibraryStateTest.php \Drupal\Tests\media_library\Kernel\MediaLibraryStateTest::testFromRequestQueryLess()
  2. 10 core/modules/media_library/tests/src/Kernel/MediaLibraryStateTest.php \Drupal\Tests\media_library\Kernel\MediaLibraryStateTest::testFromRequestQueryLess()
  3. 11.x core/modules/media_library/tests/src/Kernel/MediaLibraryStateTest.php \Drupal\Tests\media_library\Kernel\MediaLibraryStateTest::testFromRequestQueryLess()

@covers ::fromRequest

File

core/modules/media_library/tests/src/Kernel/MediaLibraryStateTest.php, line 289

Class

MediaLibraryStateTest
Tests the media library state value object.

Namespace

Drupal\Tests\media_library\Kernel

Code

public function testFromRequestQueryLess() {
    $this->expectException(\InvalidArgumentException::class);
    $this->expectExceptionMessage('The opener ID parameter is required and must be a string.');
    $state = MediaLibraryState::fromRequest(new Request());
    $this->assertInstanceOf(MediaLibraryState::class, $state);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.