You are here

public function HiddenLanguageAccessTest::testAccess in Hidden Language 7

File

./hidden_language.test, line 186
Tests for Hidden Language module.

Class

HiddenLanguageAccessTest

Code

public function testAccess() {

  // Test if Polish language is accessible.
  $this
    ->get('pl', '<front>');
  $this
    ->assertResponse(200);

  // Test if Russian language is accessible.
  $this
    ->get('ru', '<front>');
  $this
    ->assertResponse(200);

  // Test if English language is accessible.
  $this
    ->get('en', '<front>');
  $this
    ->assertResponse(200);

  // Hide English and Russian languages.
  $this
    ->loginAdminUser();
  $this
    ->hideLanguage('en');
  $this
    ->hideLanguage('ru');
  $this
    ->drupalLogout();

  // Test if Polish language is accessible.
  $this
    ->get('pl', '<front>');
  $this
    ->assertResponse(200);

  // Test if Russian language is NOT accessible.
  $this
    ->get('ru', '<front>');
  $this
    ->assertResponse(403);

  // Test if English language is NOT accessible.
  $this
    ->get('en', '<front>');
  $this
    ->assertResponse(403);
}