Commit 9fd145fc authored by alexpott's avatar alexpott

Issue #2396687 by hussainweb: Clean-up image module test members - ensure...

Issue #2396687 by hussainweb: Clean-up image module test members - ensure property definition and use of camelCase naming convention
parent 04fc7879
......@@ -58,7 +58,7 @@ function _testImageFieldFormatters($scheme) {
$this->assertLinkByHref(\Drupal::url('image.style_list'), 0, 'Link to image styles configuration is found');
// Remove 'administer image styles' permission from testing admin user.
$admin_user_roles = $this->admin_user->getRoles(TRUE);
$admin_user_roles = $this->adminUser->getRoles(TRUE);
user_role_change_permissions(reset($admin_user_roles), array('administer image styles' => FALSE));
// Go to manage display page again.
......@@ -127,7 +127,7 @@ function _testImageFieldFormatters($scheme) {
$this->assertResponse('403', 'Access denied to original image as anonymous user.');
// Log in again.
$this->drupalLogin($this->admin_user);
$this->drupalLogin($this->adminUser);
}
// Test the image linked to content formatter.
......
......@@ -34,7 +34,12 @@
*/
public static $modules = array('node', 'image', 'field_ui', 'image_module_test');
protected $admin_user;
/**
* An user with permissions to administer content types and image styles.
*
* @var \Drupal\user\UserInterface
*/
protected $adminUser;
protected function setUp() {
parent::setUp();
......@@ -45,8 +50,8 @@ protected function setUp() {
$this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
}
$this->admin_user = $this->drupalCreateUser(array('access content', 'access administration pages', 'administer site configuration', 'administer content types', 'administer node fields', 'administer nodes', 'create article content', 'edit any article content', 'delete any article content', 'administer image styles', 'administer node display'));
$this->drupalLogin($this->admin_user);
$this->adminUser = $this->drupalCreateUser(array('access content', 'access administration pages', 'administer site configuration', 'administer content types', 'administer node fields', 'administer nodes', 'create article content', 'edit any article content', 'delete any article content', 'administer image styles', 'administer node display'));
$this->drupalLogin($this->adminUser);
}
/**
......
......@@ -40,7 +40,7 @@ protected function setUp() {
parent::setUp();
// Create user.
$this->admin_user = $this->drupalCreateUser(array(
$this->adminUser = $this->drupalCreateUser(array(
'administer responsive images',
'access content',
'access administration pages',
......@@ -53,7 +53,7 @@ protected function setUp() {
'delete any article content',
'administer image styles'
));
$this->drupalLogin($this->admin_user);
$this->drupalLogin($this->adminUser);
// Add responsive image mapping.
$this->responsiveImgMapping = entity_create('responsive_image_mapping', array(
'id' => 'mapping_one',
......@@ -180,7 +180,7 @@ protected function doTestResponsiveImageFieldFormatters($scheme, $empty_styles =
$this->assertResponse('403', 'Access denied to original image as anonymous user.');
// Log in again.
$this->drupalLogin($this->admin_user);
$this->drupalLogin($this->adminUser);
}
// Use the responsive image formatter with a responsive image mapping.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment