You are here

public function ContentLanguageAccessTestCase::testContentLanguageAccess in Content Language Access 6

Same name and namespace in other branches
  1. 7 content_language_access.test \ContentLanguageAccessTestCase::testContentLanguageAccess()

Tests each content in each language.

File

./content_language_access.test, line 141
Test suite for content language access module

Class

ContentLanguageAccessTestCase
@file Test suite for content language access module

Code

public function testContentLanguageAccess() {
  $this
    ->drupalLogin($this->visitor);
  $languages = $this
    ->getLanguageList(FALSE);
  foreach ($this->nodes as $node) {
    foreach ($languages as $language) {
      if ($language->prefix) {
        $prefix = $language->prefix . '/';
      }
      else {
        $prefix = '';
      }
      $this
        ->drupalGet($prefix . 'node/' . $node->nid);
      if ($node->language == '' || $node->language == $language->language) {
        $this
          ->assertResponse(200);
      }
      else {
        $this
          ->assertResponse(403);
      }
    }
  }
}