You are here

protected function MediaRevisionsUiAccessTest::assertRevisionViewStatusCode in Media Revisions UI 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Functional/MediaRevisionsUiAccessTest.php \Drupal\Tests\media_revisions_ui\Functional\MediaRevisionsUiAccessTest::assertRevisionViewStatusCode()

Visits media revision view page and asserts status code.

Parameters

\Drupal\Core\Entity\EntityInterface $media: The media entity.

int $expectedStatusCode: Expected status code when visiting revision view page.

Throws

\Behat\Mink\Exception\ExpectationException

1 call to MediaRevisionsUiAccessTest::assertRevisionViewStatusCode()
MediaRevisionsUiAccessTest::testOperationsAccess in tests/src/Functional/MediaRevisionsUiAccessTest.php
Tests access of revision operations.

File

tests/src/Functional/MediaRevisionsUiAccessTest.php, line 195

Class

MediaRevisionsUiAccessTest
Tests media revision pemissions.

Namespace

Drupal\Tests\media_revisions_ui\Functional

Code

protected function assertRevisionViewStatusCode(EntityInterface $media, $expectedStatusCode) {
  $this
    ->drupalGet("/media/{$media->id()}/revisions/{$media->getRevisionId()}/view");
  $this
    ->assertSession()
    ->statusCodeEquals($expectedStatusCode);
}