You are here

public function UnpublishedNodesRedirectTest::testChecksBeforeRedirect in Unpublished Nodes Redirect 8

Same name and namespace in other branches
  1. 2.x tests/src/Unit/UnpublishedNodesRedirectTest.php \Drupal\Tests\unpublished_nodes_redirect\Unit\UnpublishedNodesRedirectTest::testChecksBeforeRedirect()

Tests checks before redirect.

File

tests/src/Unit/UnpublishedNodesRedirectTest.php, line 42

Class

UnpublishedNodesRedirectTest
Test for Unpublished nodes redirect module.

Namespace

Drupal\Tests\unpublished_nodes_redirect\Unit

Code

public function testChecksBeforeRedirect() {
  $this
    ->assertTrue(TRUE, $this->utils
    ->checksBeforeRedirect(0, TRUE, '', 'test/path', 301));
  $this
    ->assertFalse(FALSE, $this->utils
    ->checksBeforeRedirect(1, TRUE, '', 'test/path', 301));
  $this
    ->assertFalse(FALSE, $this->utils
    ->checksBeforeRedirect(0, FALSE, '', 'test/path', 301));
  $this
    ->assertFalse(FALSE, $this->utils
    ->checksBeforeRedirect(0, FALSE, '', '', 301));
  $this
    ->assertFalse(FALSE, $this->utils
    ->checksBeforeRedirect(0, FALSE, '', 'test/path', 0));
}