You are here

public function BlockClassPermissionTestCase::testPermission in Block Class 7.2

Same name and namespace in other branches
  1. 7 block_class.test \BlockClassPermissionTestCase::testPermission()

Ensure Block CSS classes field is only visible with the right permissions.

Test if a user without 'administer block classes' permission has access to the Block CSS classes field on the block configuration page.

File

./block_class.test, line 180
Test the Block Class module.

Class

BlockClassPermissionTestCase
Test Block Class permissions.

Code

public function testPermission() {

  // Browse to the "Main page content" block editing form page.
  $this
    ->drupalGet("admin/structure/block/manage/{$this->module}/{$this->delta}/configure");

  // Check that the css_class field couldn't be found.
  // If the field is not found, it can't be submitted through drupalPost.
  $this
    ->assertNoFieldById('css_class', 'The Css classes field was not found on the page.');
}