You are here

public function CacheFlushUICRUDAccessTest::accessLogged in CacheFlush 8

Test the access for user with permissions for own content.

1 call to CacheFlushUICRUDAccessTest::accessLogged()
CacheFlushUICRUDAccessTest::testAccess in modules/cacheflush_ui/tests/src/Functional/CacheFlushUICRUDAccessTest.php
Run CRUD access test functions.

File

modules/cacheflush_ui/tests/src/Functional/CacheFlushUICRUDAccessTest.php, line 173

Class

CacheFlushUICRUDAccessTest
Test cacheflush UI access on links and interface.

Namespace

Drupal\cacheflush_ui\Tests

Code

public function accessLogged() {
  $this
    ->drupalLogin($this->loggedUser);

  // Access to administration page.
  $this
    ->cacheflushUrlAccess($this->urls['admin'], 403);

  // Access to new entity create.
  $this
    ->cacheflushUrlAccess($this->urls['new'], 200);

  // Access to cache clear.
  $this
    ->cacheflushUrlAccess($this->urls['clear'] . '1', 200);
  $this
    ->cacheflushUrlAccess($this->urls['clear'] . '2', 403);

  // Access to CRUD for own entity.
  $this
    ->cacheflushUrlAccess($this->urls['view'] . '1', 200);
  $this
    ->cacheflushUrlAccess(str_replace("[ID]", 1, $this->urls['edit']), 200);
  $this
    ->cacheflushUrlAccess(str_replace("[ID]", 1, $this->urls['delete']), 200);

  // Access to CRUD for other user created entity.
  $this
    ->cacheflushUrlAccess($this->urls['view'] . '2', 403);
  $this
    ->cacheflushUrlAccess(str_replace("[ID]", 2, $this->urls['edit']), 403);
  $this
    ->cacheflushUrlAccess(str_replace("[ID]", 2, $this->urls['delete']), 403);
  $this
    ->drupalLogout();
}