public function CacheFlushUICRUDAccessTest::testAccessLogged in CacheFlush 7.3
Test the access for user with permissions for own content.
File
- modules/
cacheflush_ui/ cacheflush_ui.test, line 351 - Contains test suite for cacheflush ui module.
Class
- CacheFlushUICRUDAccessTest
- Defines a test for cacheflush ui module CRUD access.
Code
public function testAccessLogged() {
$this
->drupalLogin($this->logged_user);
// 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(str_replace("[ID]", 1, $this->urls['view']), 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(str_replace("[ID]", 2, $this->urls['view']), 403);
$this
->cacheflushUrlAccess(str_replace("[ID]", 2, $this->urls['edit']), 403);
$this
->cacheflushUrlAccess(str_replace("[ID]", 2, $this->urls['delete']), 403);
$this
->drupalLogout();
}