You are here

protected function MediaRevisionsUiAccessTest::assertRevisionRevertStatusCode 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::assertRevisionRevertStatusCode()

Visits media revision revert page and asserts status code.

Parameters

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

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

Throws

\Behat\Mink\Exception\ExpectationException

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

File

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

Class

MediaRevisionsUiAccessTest
Tests media revision pemissions.

Namespace

Drupal\Tests\media_revisions_ui\Functional

Code

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