summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-04-02 11:48:29 +0100
committerAlex Pott2015-04-02 11:48:29 +0100
commitf0c731f200cc37bd42f4f3d6ca6cf3a3c8da5c3c (patch)
tree843519d915095fc0d250238ed7bf365fd4a505e0
parent7cac6fa86a8b8f74d46dd99dc93c1b59d04f354a (diff)
Issue #2389455 by hussainweb, AjitS, Mile23, subhojit777, tibbsa, Ayesh: Clean-up system module test members - ensure property definition and use of camelCase naming convention
-rw-r--r--core/modules/system/src/Tests/Ajax/FormValuesTest.php3
-rw-r--r--core/modules/system/src/Tests/Ajax/MultiFormTest.php3
-rw-r--r--core/modules/system/src/Tests/Cache/CacheTestBase.php18
-rw-r--r--core/modules/system/src/Tests/Cache/ClearTest.php8
-rw-r--r--core/modules/system/src/Tests/Common/FormatDateTest.php5
-rw-r--r--core/modules/system/src/Tests/Common/SizeUnitTest.php18
-rw-r--r--core/modules/system/src/Tests/Database/SchemaTest.php2
-rw-r--r--core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php28
-rw-r--r--core/modules/system/src/Tests/Entity/EntityFieldTest.php60
-rw-r--r--core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php20
-rw-r--r--core/modules/system/src/Tests/Entity/EntityListBuilderTest.php4
-rw-r--r--core/modules/system/src/Tests/Entity/EntityOperationsTest.php5
-rw-r--r--core/modules/system/src/Tests/Entity/EntityRevisionsTest.php13
-rw-r--r--core/modules/system/src/Tests/Entity/EntityTranslationTest.php44
-rw-r--r--core/modules/system/src/Tests/Entity/EntityValidationTest.php18
-rw-r--r--core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php98
-rw-r--r--core/modules/system/src/Tests/Entity/FieldTranslationSqlStorageTest.php12
-rw-r--r--core/modules/system/src/Tests/File/ConfigTest.php3
-rw-r--r--core/modules/system/src/Tests/File/NameMungingTest.php20
-rw-r--r--core/modules/system/src/Tests/FileTransfer/MockTestConnection.php4
-rw-r--r--core/modules/system/src/Tests/Form/ElementsVerticalTabsTest.php22
-rw-r--r--core/modules/system/src/Tests/Form/FormCacheTest.php26
-rw-r--r--core/modules/system/src/Tests/Form/RebuildTest.php15
-rw-r--r--core/modules/system/src/Tests/Form/StorageTest.php3
-rw-r--r--core/modules/system/src/Tests/Image/ToolkitGdTest.php4
-rw-r--r--core/modules/system/src/Tests/Image/ToolkitSetupFormTest.php6
-rw-r--r--core/modules/system/src/Tests/Mail/MailTest.php8
-rw-r--r--core/modules/system/src/Tests/Menu/BreadcrumbTest.php50
-rw-r--r--core/modules/system/src/Tests/Menu/MenuRouterTest.php16
-rw-r--r--core/modules/system/src/Tests/Module/ModuleTestBase.php6
-rw-r--r--core/modules/system/src/Tests/Pager/PagerTest.php11
-rw-r--r--core/modules/system/src/Tests/System/AccessDeniedTest.php32
-rw-r--r--core/modules/system/src/Tests/System/AdminTest.php16
-rw-r--r--core/modules/system/src/Tests/System/DateTimeTest.php3
-rw-r--r--core/modules/system/src/Tests/System/DefaultMobileMetaTagsTest.php13
-rw-r--r--core/modules/system/src/Tests/System/FrontPageTest.php21
-rw-r--r--core/modules/system/src/Tests/System/MainContentFallbackTest.php16
-rw-r--r--core/modules/system/src/Tests/System/PageNotFoundTest.php10
-rw-r--r--core/modules/system/src/Tests/System/PageTitleTest.php8
-rw-r--r--core/modules/system/src/Tests/System/SiteMaintenanceTest.php8
-rw-r--r--core/modules/system/src/Tests/System/SystemAuthorizeTest.php3
-rw-r--r--core/modules/system/src/Tests/System/ThemeTest.php13
-rw-r--r--core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php12
-rw-r--r--core/modules/system/src/Tests/Theme/TwigTransTest.php6
-rw-r--r--core/modules/system/src/Tests/Update/InvalidUpdateHookTest.php12
-rw-r--r--core/modules/system/src/Tests/Update/UpdateScriptTest.php59
-rw-r--r--core/modules/system/src/Tests/Update/UpdatesWith7xTest.php12
47 files changed, 432 insertions, 365 deletions
diff --git a/core/modules/system/src/Tests/Ajax/FormValuesTest.php b/core/modules/system/src/Tests/Ajax/FormValuesTest.php
index 17e74f6..c8f164b 100644
--- a/core/modules/system/src/Tests/Ajax/FormValuesTest.php
+++ b/core/modules/system/src/Tests/Ajax/FormValuesTest.php
@@ -18,8 +18,7 @@ class FormValuesTest extends AjaxTestBase {
protected function setUp() {
parent::setUp();
- $this->web_user = $this->drupalCreateUser(array('access content'));
- $this->drupalLogin($this->web_user);
+ $this->drupalLogin($this->drupalCreateUser(array('access content')));
}
/**
diff --git a/core/modules/system/src/Tests/Ajax/MultiFormTest.php b/core/modules/system/src/Tests/Ajax/MultiFormTest.php
index 5710b70..449861c 100644
--- a/core/modules/system/src/Tests/Ajax/MultiFormTest.php
+++ b/core/modules/system/src/Tests/Ajax/MultiFormTest.php
@@ -47,8 +47,7 @@ class MultiFormTest extends AjaxTestBase {
->save();
// Login a user who can create 'page' nodes.
- $this->web_user = $this->drupalCreateUser(array('create page content'));
- $this->drupalLogin($this->web_user);
+ $this->drupalLogin ($this->drupalCreateUser(array('create page content')));
}
/**
diff --git a/core/modules/system/src/Tests/Cache/CacheTestBase.php b/core/modules/system/src/Tests/Cache/CacheTestBase.php
index 251e528..df52a37 100644
--- a/core/modules/system/src/Tests/Cache/CacheTestBase.php
+++ b/core/modules/system/src/Tests/Cache/CacheTestBase.php
@@ -14,9 +14,9 @@ use Drupal\simpletest\WebTestBase;
*/
abstract class CacheTestBase extends WebTestBase {
- protected $default_bin = 'render';
- protected $default_cid = 'test_temporary';
- protected $default_value = 'CacheTest';
+ protected $defaultBin = 'render';
+ protected $defaultCid = 'test_temporary';
+ protected $defaultValue = 'CacheTest';
/**
* Checks whether or not a cache entry exists.
@@ -32,7 +32,7 @@ abstract class CacheTestBase extends WebTestBase {
*/
protected function checkCacheExists($cid, $var, $bin = NULL) {
if ($bin == NULL) {
- $bin = $this->default_bin;
+ $bin = $this->defaultBin;
}
$cached = \Drupal::cache($bin)->get($cid);
@@ -54,13 +54,13 @@ abstract class CacheTestBase extends WebTestBase {
*/
protected function assertCacheExists($message, $var = NULL, $cid = NULL, $bin = NULL) {
if ($bin == NULL) {
- $bin = $this->default_bin;
+ $bin = $this->defaultBin;
}
if ($cid == NULL) {
- $cid = $this->default_cid;
+ $cid = $this->defaultCid;
}
if ($var == NULL) {
- $var = $this->default_value;
+ $var = $this->defaultValue;
}
$this->assertTrue($this->checkCacheExists($cid, $var, $bin), $message);
@@ -78,10 +78,10 @@ abstract class CacheTestBase extends WebTestBase {
*/
function assertCacheRemoved($message, $cid = NULL, $bin = NULL) {
if ($bin == NULL) {
- $bin = $this->default_bin;
+ $bin = $this->defaultBin;
}
if ($cid == NULL) {
- $cid = $this->default_cid;
+ $cid = $this->defaultCid;
}
$cached = \Drupal::cache($bin)->get($cid);
diff --git a/core/modules/system/src/Tests/Cache/ClearTest.php b/core/modules/system/src/Tests/Cache/ClearTest.php
index 1a152ed..7ba9419 100644
--- a/core/modules/system/src/Tests/Cache/ClearTest.php
+++ b/core/modules/system/src/Tests/Cache/ClearTest.php
@@ -17,8 +17,8 @@ use Drupal\Core\Cache\Cache;
class ClearTest extends CacheTestBase {
protected function setUp() {
- $this->default_bin = 'render';
- $this->default_value = $this->randomMachineName(10);
+ $this->defaultBin = 'render';
+ $this->defaultValue = $this->randomMachineName(10);
parent::setUp();
}
@@ -32,7 +32,7 @@ class ClearTest extends CacheTestBase {
$this->assertTrue($bins, 'Cache::getBins() returned bins to flush.');
foreach ($bins as $bin => $cache_backend) {
$cid = 'test_cid_clear' . $bin;
- $cache_backend->set($cid, $this->default_value);
+ $cache_backend->set($cid, $this->defaultValue);
}
// Remove all caches then make sure that they are cleared.
@@ -40,7 +40,7 @@ class ClearTest extends CacheTestBase {
foreach ($bins as $bin => $cache_backend) {
$cid = 'test_cid_clear' . $bin;
- $this->assertFalse($this->checkCacheExists($cid, $this->default_value, $bin), format_string('All cache entries removed from @bin.', array('@bin' => $bin)));
+ $this->assertFalse($this->checkCacheExists($cid, $this->defaultValue, $bin), format_string('All cache entries removed from @bin.', array('@bin' => $bin)));
}
}
}
diff --git a/core/modules/system/src/Tests/Common/FormatDateTest.php b/core/modules/system/src/Tests/Common/FormatDateTest.php
index 9d9a265..33a7f91 100644
--- a/core/modules/system/src/Tests/Common/FormatDateTest.php
+++ b/core/modules/system/src/Tests/Common/FormatDateTest.php
@@ -56,9 +56,8 @@ class FormatDateTest extends WebTestBase {
* Tests admin-defined formats in format_date().
*/
function testAdminDefinedFormatDate() {
- // Create an admin user.
- $this->admin_user = $this->drupalCreateUser(array('administer site configuration'));
- $this->drupalLogin($this->admin_user);
+ // Create and log in an admin user.
+ $this->drupalLogin($this->drupalCreateUser(array('administer site configuration')));
// Add new date format.
$edit = array(
diff --git a/core/modules/system/src/Tests/Common/SizeUnitTest.php b/core/modules/system/src/Tests/Common/SizeUnitTest.php
index 76fe652..afe1d3a 100644
--- a/core/modules/system/src/Tests/Common/SizeUnitTest.php
+++ b/core/modules/system/src/Tests/Common/SizeUnitTest.php
@@ -17,13 +17,13 @@ use Drupal\simpletest\KernelTestBase;
* @group Common
*/
class SizeUnitTest extends KernelTestBase {
- protected $exact_test_cases;
- protected $rounded_test_cases;
+ protected $exactTestCases;
+ protected $roundedTestCases;
protected function setUp() {
parent::setUp();
$kb = Bytes::KILOBYTE;
- $this->exact_test_cases = array(
+ $this->exactTestCases = array(
'1 byte' => 1,
'1 KB' => $kb,
'1 MB' => $kb * $kb,
@@ -34,12 +34,12 @@ class SizeUnitTest extends KernelTestBase {
'1 ZB' => $kb * $kb * $kb * $kb * $kb * $kb * $kb,
'1 YB' => $kb * $kb * $kb * $kb * $kb * $kb * $kb * $kb,
);
- $this->rounded_test_cases = array(
+ $this->roundedTestCases = array(
'2 bytes' => 2,
'1 MB' => ($kb * $kb) - 1, // rounded to 1 MB (not 1000 or 1024 kilobyte!)
- round(3623651 / ($this->exact_test_cases['1 MB']), 2) . ' MB' => 3623651, // megabytes
- round(67234178751368124 / ($this->exact_test_cases['1 PB']), 2) . ' PB' => 67234178751368124, // petabytes
- round(235346823821125814962843827 / ($this->exact_test_cases['1 YB']), 2) . ' YB' => 235346823821125814962843827, // yottabytes
+ round(3623651 / ($this->exactTestCases['1 MB']), 2) . ' MB' => 3623651, // megabytes
+ round(67234178751368124 / ($this->exactTestCases['1 PB']), 2) . ' PB' => 67234178751368124, // petabytes
+ round(235346823821125814962843827 / ($this->exactTestCases['1 YB']), 2) . ' YB' => 235346823821125814962843827, // yottabytes
);
}
@@ -47,7 +47,7 @@ class SizeUnitTest extends KernelTestBase {
* Checks that format_size() returns the expected string.
*/
function testCommonFormatSize() {
- foreach (array($this->exact_test_cases, $this->rounded_test_cases) as $test_cases) {
+ foreach (array($this->exactTestCases, $this->roundedTestCases) as $test_cases) {
foreach ($test_cases as $expected => $input) {
$this->assertEqual(
($result = format_size($input, NULL)),
@@ -62,7 +62,7 @@ class SizeUnitTest extends KernelTestBase {
* Cross-tests Bytes::toInt() and format_size().
*/
function testCommonParseSizeFormatSize() {
- foreach ($this->exact_test_cases as $size) {
+ foreach ($this->exactTestCases as $size) {
$this->assertEqual(
$size,
($parsed_size = Bytes::toInt($string = format_size($size, NULL))),
diff --git a/core/modules/system/src/Tests/Database/SchemaTest.php b/core/modules/system/src/Tests/Database/SchemaTest.php
index 6b96e3d..a59b9d9 100644
--- a/core/modules/system/src/Tests/Database/SchemaTest.php
+++ b/core/modules/system/src/Tests/Database/SchemaTest.php
@@ -23,7 +23,7 @@ class SchemaTest extends KernelTestBase {
/**
* A global counter for table and field creation.
*/
- var $counter;
+ protected $counter;
/**
* Tests database interactions.
diff --git a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
index df0b6d7..23d5f79 100644
--- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
+++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
@@ -42,14 +42,14 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
*
* @var \Drupal\Core\Entity\EntityInterface
*/
- protected $referencing_entity;
+ protected $referencingEntity;
/**
* The entity instance not referencing the main entity.
*
* @var \Drupal\Core\Entity\EntityInterface
*/
- protected $non_referencing_entity;
+ protected $nonReferencingEntity;
/**
* {@inheritdoc}
@@ -96,8 +96,8 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
// Create a referencing and a non-referencing entity.
list(
- $this->referencing_entity,
- $this->non_referencing_entity,
+ $this->referencingEntity,
+ $this->nonReferencingEntity,
) = $this->createReferenceTestEntities($this->entity);
}
@@ -305,8 +305,8 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
*/
public function testReferencedEntity() {
$entity_type = $this->entity->getEntityTypeId();
- $referencing_entity_url = $this->referencing_entity->urlInfo('canonical');
- $non_referencing_entity_url = $this->non_referencing_entity->urlInfo('canonical');
+ $referencing_entity_url = $this->referencingEntity->urlInfo('canonical');
+ $non_referencing_entity_url = $this->nonReferencingEntity->urlInfo('canonical');
$listing_url = Url::fromRoute('entity.entity_test.collection_referencing_entities', [
'entity_reference_field_name' => $entity_type . '_reference',
'referenced_entity_type' => $entity_type,
@@ -335,7 +335,7 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
// Generate the cache tags for the (non) referencing entities.
$referencing_entity_cache_tags = Cache::mergeTags(
- $this->referencing_entity->getCacheTags(),
+ $this->referencingEntity->getCacheTags(),
\Drupal::entityManager()->getViewBuilder('entity_test')->getCacheTags(),
// Includes the main entity's cache tags, since this entity references it.
$this->entity->getCacheTags(),
@@ -344,7 +344,7 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
['rendered']
);
$non_referencing_entity_cache_tags = Cache::mergeTags(
- $this->non_referencing_entity->getCacheTags(),
+ $this->nonReferencingEntity->getCacheTags(),
\Drupal::entityManager()->getViewBuilder('entity_test')->getCacheTags(),
['rendered']
);
@@ -368,7 +368,7 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
// Verify a cache hit, but also the presence of the correct cache tags.
$this->verifyPageCache($referencing_entity_url, 'HIT', Cache::mergeTags($referencing_entity_cache_tags, $page_cache_tags));
// Also verify the existence of an entity render cache entry.
- $cache_keys = ['entity_view', 'entity_test', $this->referencing_entity->id(), 'full'];
+ $cache_keys = ['entity_view', 'entity_test', $this->referencingEntity->id(), 'full'];
$cid = $this->createCacheId($cache_keys, $entity_cache_contexts);
$redirected_cid = $this->createRedirectedCacheId($cache_keys, $entity_cache_contexts);
$this->verifyRenderCache($cid, $referencing_entity_cache_tags, $redirected_cid);
@@ -378,7 +378,7 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
// Verify a cache hit, but also the presence of the correct cache tags.
$this->verifyPageCache($non_referencing_entity_url, 'HIT', Cache::mergeTags($non_referencing_entity_cache_tags, $page_cache_tags));
// Also verify the existence of an entity render cache entry.
- $cache_keys = ['entity_view', 'entity_test', $this->non_referencing_entity->id(), 'full'];
+ $cache_keys = ['entity_view', 'entity_test', $this->nonReferencingEntity->id(), 'full'];
$cid = $this->createCacheId($cache_keys, $entity_cache_contexts);
$this->verifyRenderCache($cid, $non_referencing_entity_cache_tags);
@@ -431,7 +431,7 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
// for every route except the ones for the non-referencing entity and the
// empty entity listing.
$this->pass("Test modification of referencing entity.", 'Debug');
- $this->referencing_entity->save();
+ $this->referencingEntity->save();
$this->verifyPageCache($referencing_entity_url, 'MISS');
$this->verifyPageCache($listing_url, 'MISS');
$this->verifyPageCache($nonempty_entity_listing_url, 'HIT');
@@ -447,7 +447,7 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
// Verify that after modifying the non-referencing entity, there is a cache
// miss only for the non-referencing entity route.
$this->pass("Test modification of non-referencing entity.", 'Debug');
- $this->non_referencing_entity->save();
+ $this->nonReferencingEntity->save();
$this->verifyPageCache($referencing_entity_url, 'HIT');
$this->verifyPageCache($listing_url, 'HIT');
$this->verifyPageCache($empty_entity_listing_url, 'HIT');
@@ -608,7 +608,7 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
// Verify cache hits.
$referencing_entity_cache_tags = Cache::mergeTags(
- $this->referencing_entity->getCacheTags(),
+ $this->referencingEntity->getCacheTags(),
\Drupal::entityManager()->getViewBuilder('entity_test')->getCacheTags(),
['rendered']
);
@@ -655,7 +655,7 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
* The redirected (post-bubbling) CID, if any.
*/
protected function createRedirectedCacheId(array $keys, array $contexts) {
- $additional_cache_contexts = $this->getAdditionalCacheContextsForEntity($this->referencing_entity);
+ $additional_cache_contexts = $this->getAdditionalCacheContextsForEntity($this->referencingEntity);
if (count($additional_cache_contexts)) {
return $this->createCacheId($keys, Cache::mergeContexts($contexts, $additional_cache_contexts));
}
diff --git a/core/modules/system/src/Tests/Entity/EntityFieldTest.php b/core/modules/system/src/Tests/Entity/EntityFieldTest.php
index 8be7a1d..4f562a9 100644
--- a/core/modules/system/src/Tests/Entity/EntityFieldTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityFieldTest.php
@@ -35,17 +35,17 @@ class EntityFieldTest extends EntityUnitTestBase {
/**
* @var string
*/
- protected $entity_name;
+ protected $entityName;
/**
* @var \Drupal\user\Entity\User
*/
- protected $entity_user;
+ protected $entityUser;
/**
* @var string
*/
- protected $entity_field_text;
+ protected $entityFieldText;
protected function setUp() {
parent::setUp();
@@ -70,18 +70,18 @@ class EntityFieldTest extends EntityUnitTestBase {
* @return \Drupal\Core\Entity\EntityInterface
*/
protected function createTestEntity($entity_type) {
- $this->entity_name = $this->randomMachineName();
- $this->entity_user = $this->createUser();
- $this->entity_field_text = $this->randomMachineName();
+ $this->entityName = $this->randomMachineName();
+ $this->entityUser = $this->createUser();
+ $this->entityFieldText = $this->randomMachineName();
// Pass in the value of the name field when creating. With the user
// field we test setting a field after creation.
$entity = entity_create($entity_type);
- $entity->user_id->target_id = $this->entity_user->id();
- $entity->name->value = $this->entity_name;
+ $entity->user_id->target_id = $this->entityUser->id();
+ $entity->name->value = $this->entityName;
// Set a value for the test field.
- $entity->field_test_text->value = $this->entity_field_text;
+ $entity->field_test_text->value = $this->entityFieldText;
return $entity;
}
@@ -111,9 +111,9 @@ class EntityFieldTest extends EntityUnitTestBase {
$this->assertTrue($entity->name instanceof FieldItemListInterface, format_string('%entity_type: Field implements interface', array('%entity_type' => $entity_type)));
$this->assertTrue($entity->name[0] instanceof FieldItemInterface, format_string('%entity_type: Field item implements interface', array('%entity_type' => $entity_type)));
- $this->assertEqual($this->entity_name, $entity->name->value, format_string('%entity_type: Name value can be read.', array('%entity_type' => $entity_type)));
- $this->assertEqual($this->entity_name, $entity->name[0]->value, format_string('%entity_type: Name value can be read through list access.', array('%entity_type' => $entity_type)));
- $this->assertEqual($entity->name->getValue(), array(0 => array('value' => $this->entity_name)), format_string('%entity_type: Plain field value returned.', array('%entity_type' => $entity_type)));
+ $this->assertEqual($this->entityName, $entity->name->value, format_string('%entity_type: Name value can be read.', array('%entity_type' => $entity_type)));
+ $this->assertEqual($this->entityName, $entity->name[0]->value, format_string('%entity_type: Name value can be read through list access.', array('%entity_type' => $entity_type)));
+ $this->assertEqual($entity->name->getValue(), array(0 => array('value' => $this->entityName)), format_string('%entity_type: Plain field value returned.', array('%entity_type' => $entity_type)));
// Change the name.
$new_name = $this->randomMachineName();
@@ -129,8 +129,8 @@ class EntityFieldTest extends EntityUnitTestBase {
$this->assertTrue($entity->user_id instanceof FieldItemListInterface, format_string('%entity_type: Field implements interface', array('%entity_type' => $entity_type)));
$this->assertTrue($entity->user_id[0] instanceof FieldItemInterface, format_string('%entity_type: Field item implements interface', array('%entity_type' => $entity_type)));
- $this->assertEqual($this->entity_user->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
- $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
+ $this->assertEqual($this->entityUser->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
+ $this->assertEqual($this->entityUser->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
// Change the assigned user by entity.
$new_user1 = $this->createUser();
@@ -241,28 +241,28 @@ class EntityFieldTest extends EntityUnitTestBase {
$this->assertEqual(\Drupal::languageManager()->getDefaultLanguage(), $entity->{$langcode_key}->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
// Access the text field and test updating.
- $this->assertEqual($entity->field_test_text->value, $this->entity_field_text, format_string('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
+ $this->assertEqual($entity->field_test_text->value, $this->entityFieldText, format_string('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
$new_text = $this->randomMachineName();
$entity->field_test_text->value = $new_text;
$this->assertEqual($entity->field_test_text->value, $new_text, format_string('%entity_type: Updated text field can be read.', array('%entity_type' => $entity_type)));
// Test creating the entity by passing in plain values.
- $this->entity_name = $this->randomMachineName();
- $name_item[0]['value'] = $this->entity_name;
- $this->entity_user = $this->createUser();
- $user_item[0]['target_id'] = $this->entity_user->id();
- $this->entity_field_text = $this->randomMachineName();
- $text_item[0]['value'] = $this->entity_field_text;
+ $this->entityName = $this->randomMachineName();
+ $name_item[0]['value'] = $this->entityName;
+ $this->entityUser = $this->createUser();
+ $user_item[0]['target_id'] = $this->entityUser->id();
+ $this->entityFieldText = $this->randomMachineName();
+ $text_item[0]['value'] = $this->entityFieldText;
$entity = entity_create($entity_type, array(
'name' => $name_item,
'user_id' => $user_item,
'field_test_text' => $text_item,
));
- $this->assertEqual($this->entity_name, $entity->name->value, format_string('%entity_type: Name value can be read.', array('%entity_type' => $entity_type)));
- $this->assertEqual($this->entity_user->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
- $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
- $this->assertEqual($this->entity_field_text, $entity->field_test_text->value, format_string('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
+ $this->assertEqual($this->entityName, $entity->name->value, format_string('%entity_type: Name value can be read.', array('%entity_type' => $entity_type)));
+ $this->assertEqual($this->entityUser->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
+ $this->assertEqual($this->entityUser->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
+ $this->assertEqual($this->entityFieldText, $entity->field_test_text->value, format_string('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
// Tests copying field values by assigning the TypedData objects.
$entity2 = $this->createTestEntity($entity_type);
@@ -374,9 +374,9 @@ class EntityFieldTest extends EntityUnitTestBase {
$this->assertTrue(is_string($entity->uuid->value), format_string('%entity_type: UUID value can be read.', array('%entity_type' => $entity_type)));
$this->assertEqual('en', $entity->{$langcode_key}->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
$this->assertEqual(\Drupal::languageManager()->getLanguage('en'), $entity->{$langcode_key}->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
- $this->assertEqual($this->entity_user->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
- $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
- $this->assertEqual($this->entity_field_text, $entity->field_test_text->value, format_string('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
+ $this->assertEqual($this->entityUser->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
+ $this->assertEqual($this->entityUser->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
+ $this->assertEqual($this->entityFieldText, $entity->field_test_text->value, format_string('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
}
/**
@@ -550,10 +550,10 @@ class EntityFieldTest extends EntityUnitTestBase {
$target_strings = array(
$entity->uuid->value,
'en',
- $this->entity_name,
+ $this->entityName,
// Bundle name.
$entity->bundle(),
- $this->entity_field_text,
+ $this->entityFieldText,
// Field format.
NULL,
);
diff --git a/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php b/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php
index d453b92..48eac84 100644
--- a/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php
+++ b/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php
@@ -35,14 +35,14 @@ abstract class EntityLanguageTestBase extends EntityUnitTestBase {
*
* @var string
*/
- protected $field_name;
+ protected $fieldName;
/**
* The untranslatable test field name.
*
* @var string
*/
- protected $untranslatable_field_name;
+ protected $untranslatableFieldName;
public static $modules = array('language', 'entity_test');
@@ -67,35 +67,35 @@ abstract class EntityLanguageTestBase extends EntityUnitTestBase {
$this->state->set('entity_test.translation', TRUE);
// Create a translatable test field.
- $this->field_name = Unicode::strtolower($this->randomMachineName() . '_field_name');
+ $this->fieldName = Unicode::strtolower($this->randomMachineName() . '_field_name');
// Create an untranslatable test field.
- $this->untranslatable_field_name = Unicode::strtolower($this->randomMachineName() . '_field_name');
+ $this->untranslatableFieldName = Unicode::strtolower($this->randomMachineName() . '_field_name');
// Create field fields in all entity variations.
foreach (entity_test_entity_types() as $entity_type) {
entity_create('field_storage_config', array(
- 'field_name' => $this->field_name,
+ 'field_name' => $this->fieldName,
'entity_type' => $entity_type,
'type' => 'text',
'cardinality' => 4,
))->save();
entity_create('field_config', array(
- 'field_name' => $this->field_name,
+ 'field_name' => $this->fieldName,
'entity_type' => $entity_type,
'bundle' => $entity_type,
'translatable' => TRUE,
))->save();
- $this->field[$entity_type] = FieldConfig::load($entity_type . '.' . $entity_type . '.' . $this->field_name);
+ $this->field[$entity_type] = FieldConfig::load($entity_type . '.' . $entity_type . '.' . $this->fieldName);
entity_create('field_storage_config', array(
- 'field_name' => $this->untranslatable_field_name,
+ 'field_name' => $this->untranslatableFieldName,
'entity_type' => $entity_type,
'type' => 'text',
'cardinality' => 4,
))->save();
entity_create('field_config', array(
- 'field_name' => $this->untranslatable_field_name,
+ 'field_name' => $this->untranslatableFieldName,
'entity_type' => $entity_type,
'bundle' => $entity_type,
'translatable' => FALSE,
@@ -125,7 +125,7 @@ abstract class EntityLanguageTestBase extends EntityUnitTestBase {
* The type of the entity fields are attached to.
*/
protected function toggleFieldTranslatability($entity_type, $bundle) {
- $fields = array($this->field_name, $this->untranslatable_field_name);
+ $fields = array($this->fieldName, $this->untranslatableFieldName);
foreach ($fields as $field_name) {
$field = FieldConfig::loadByName($entity_type, $bundle, $field_name);
$translatable = !$field->isTranslatable();
diff --git a/core/modules/system/src/Tests/Entity/EntityListBuilderTest.php b/core/modules/system/src/Tests/Entity/EntityListBuilderTest.php
index 10becbf..485e72c 100644
--- a/core/modules/system/src/Tests/Entity/EntityListBuilderTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityListBuilderTest.php
@@ -29,10 +29,10 @@ class EntityListBuilderTest extends WebTestBase {
parent::setUp();
// Create and login user.
- $this->web_user = $this->drupalCreateUser(array(
+ $this->webUser = $this->drupalCreateUser(array(
'administer entity_test content',
));
- $this->drupalLogin($this->web_user);
+ $this->drupalLogin($this->webUser);
}
/**
diff --git a/core/modules/system/src/Tests/Entity/EntityOperationsTest.php b/core/modules/system/src/Tests/Entity/EntityOperationsTest.php
index 4593bd9..fbd77df 100644
--- a/core/modules/system/src/Tests/Entity/EntityOperationsTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityOperationsTest.php
@@ -27,10 +27,7 @@ class EntityOperationsTest extends WebTestBase {
parent::setUp();
// Create and login user.
- $this->web_user = $this->drupalCreateUser(array(
- 'administer permissions',
- ));
- $this->drupalLogin($this->web_user);
+ $this->drupalLogin($this->drupalCreateUser(array('administer permissions')));
}
/**
diff --git a/core/modules/system/src/Tests/Entity/EntityRevisionsTest.php b/core/modules/system/src/Tests/Entity/EntityRevisionsTest.php
index 06168a2..8ce6e3d 100644
--- a/core/modules/system/src/Tests/Entity/EntityRevisionsTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityRevisionsTest.php
@@ -24,14 +24,21 @@ class EntityRevisionsTest extends WebTestBase {
*/
public static $modules = array('entity_test');
+ /**
+ * A user with permission to administer entity_test content.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ protected $webUser;
+
protected function setUp() {
parent::setUp();
// Create and login user.
- $this->web_user = $this->drupalCreateUser(array(
+ $this->webUser = $this->drupalCreateUser(array(
'administer entity_test content',
));
- $this->drupalLogin($this->web_user);
+ $this->drupalLogin($this->webUser);
}
/**
@@ -56,7 +63,7 @@ class EntityRevisionsTest extends WebTestBase {
// Create initial entity.
$entity = entity_create($entity_type, array(
'name' => 'foo',
- 'user_id' => $this->web_user->id(),
+ 'user_id' => $this->webUser->id(),
));
$entity->field_test_text->value = 'bar';
$entity->save();
diff --git a/core/modules/system/src/Tests/Entity/EntityTranslationTest.php b/core/modules/system/src/Tests/Entity/EntityTranslationTest.php
index 03300af..70ed45b 100644
--- a/core/modules/system/src/Tests/Entity/EntityTranslationTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityTranslationTest.php
@@ -52,22 +52,22 @@ class EntityTranslationTest extends EntityLanguageTestBase {
$this->assertFalse($entity->getTranslationLanguages(FALSE), format_string('%entity_type: No translations are available', array('%entity_type' => $entity_type)));
// Set the value in default language.
- $entity->set($this->field_name, array(0 => array('value' => 'default value')));
+ $entity->set($this->fieldName, array(0 => array('value' => 'default value')));
// Get the value.
- $field = $entity->getTranslation(LanguageInterface::LANGCODE_DEFAULT)->get($this->field_name);
+ $field = $entity->getTranslation(LanguageInterface::LANGCODE_DEFAULT)->get($this->fieldName);
$this->assertEqual($field->value, 'default value', format_string('%entity_type: Untranslated value retrieved.', array('%entity_type' => $entity_type)));
$this->assertEqual($field->getLangcode(), LanguageInterface::LANGCODE_NOT_SPECIFIED, format_string('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
// Set the value in a certain language. As the entity is not
// language-specific it should use the default language and so ignore the
// specified language.
- $entity->getTranslation($this->langcodes[1])->set($this->field_name, array(0 => array('value' => 'default value2')));
- $this->assertEqual($entity->get($this->field_name)->value, 'default value2', format_string('%entity_type: Untranslated value updated.', array('%entity_type' => $entity_type)));
+ $entity->getTranslation($this->langcodes[1])->set($this->fieldName, array(0 => array('value' => 'default value2')));
+ $this->assertEqual($entity->get($this->fieldName)->value, 'default value2', format_string('%entity_type: Untranslated value updated.', array('%entity_type' => $entity_type)));
$this->assertFalse($entity->getTranslationLanguages(FALSE), format_string('%entity_type: No translations are available', array('%entity_type' => $entity_type)));
// Test getting a field value using a specific language for a not
// language-specific entity.
- $field = $entity->getTranslation($this->langcodes[1])->get($this->field_name);
+ $field = $entity->getTranslation($this->langcodes[1])->get($this->fieldName);
$this->assertEqual($field->value, 'default value2', format_string('%entity_type: Untranslated value retrieved.', array('%entity_type' => $entity_type)));
$this->assertEqual($field->getLangcode(), LanguageInterface::LANGCODE_NOT_SPECIFIED, format_string('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
@@ -75,25 +75,25 @@ class EntityTranslationTest extends EntityLanguageTestBase {
// translating it.
$default_langcode = $this->langcodes[0];
$entity->{$langcode_key}->value = $default_langcode;
- $entity->{$this->field_name} = array();
+ $entity->{$this->fieldName} = array();
$this->assertEqual($entity->language(), \Drupal::languageManager()->getLanguage($this->langcodes[0]), format_string('%entity_type: Entity language retrieved.', array('%entity_type' => $entity_type)));
$this->assertFalse($entity->getTranslationLanguages(FALSE), format_string('%entity_type: No translations are available', array('%entity_type' => $entity_type)));
// Set the value in default language.
- $entity->set($this->field_name, array(0 => array('value' => 'default value')));
+ $entity->set($this->fieldName, array(0 => array('value' => 'default value')));
// Get the value.
- $field = $entity->get($this->field_name);
+ $field = $entity->get($this->fieldName);
$this->assertEqual($field->value, 'default value', format_string('%entity_type: Untranslated value retrieved.', array('%entity_type' => $entity_type)));
$this->assertEqual($field->getLangcode(), $default_langcode, format_string('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
// Set a translation.
- $entity->getTranslation($this->langcodes[1])->set($this->field_name, array(0 => array('value' => 'translation 1')));
- $field = $entity->getTranslation($this->langcodes[1])->{$this->field_name};
+ $entity->getTranslation($this->langcodes[1])->set($this->fieldName, array(0 => array('value' => 'translation 1')));
+ $field = $entity->getTranslation($this->langcodes[1])->{$this->fieldName};
$this->assertEqual($field->value, 'translation 1', format_string('%entity_type: Translated value set.', array('%entity_type' => $entity_type)));
$this->assertEqual($field->getLangcode(), $this->langcodes[1], format_string('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
// Make sure the untranslated value stays.
- $field = $entity->get($this->field_name);
+ $field = $entity->get($this->fieldName);
$this->assertEqual($field->value, 'default value', 'Untranslated value stays.');
$this->assertEqual($field->getLangcode(), $default_langcode, 'Untranslated value has the expected langcode.');
@@ -101,11 +101,11 @@ class EntityTranslationTest extends EntityLanguageTestBase {
$this->assertEqual($entity->getTranslationLanguages(FALSE), $translations, 'Translations retrieved.');
// Try to get a not available translation.
- $this->assertNull($entity->getTranslation($this->langcodes[2])->get($this->field_name)->value, format_string('%entity_type: A translation that is not available is NULL.', array('%entity_type' => $entity_type)));
+ $this->assertNull($entity->getTranslation($this->langcodes[2])->get($this->fieldName)->value, format_string('%entity_type: A translation that is not available is NULL.', array('%entity_type' => $entity_type)));
// Try to get a value using an invalid language code.
try {
- $entity->getTranslation('invalid')->get($this->field_name)->value;
+ $entity->getTranslation('invalid')->get($this->fieldName)->value;
$this->fail('Getting a translation for an invalid language is NULL.');
}
catch (\InvalidArgumentException $e) {
@@ -114,7 +114,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
// Try to set a value using an invalid language code.
try {
- $entity->getTranslation('invalid')->set($this->field_name, NULL);
+ $entity->getTranslation('invalid')->set($this->fieldName, NULL);
$this->fail(format_string('%entity_type: Setting a translation for an invalid language throws an exception.', array('%entity_type' => $entity_type)));
}
catch (\InvalidArgumentException $e) {
@@ -278,7 +278,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
// Test mixed property and field conditions.
$entity = entity_load($entity_type, reset($result), TRUE);
$field_value = $this->randomString();
- $entity->getTranslation($langcode)->set($this->field_name, array(array('value' => $field_value)));
+ $entity->getTranslation($langcode)->set($this->fieldName, array(array('value' => $field_value)));
$entity->save();
$query = \Drupal::entityQuery($entity_type);
$default_langcode_group = $query->andConditionGroup()
@@ -286,7 +286,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
->condition('name', $properties[$default_langcode]['name'][0], '=', $default_langcode);
$langcode_group = $query->andConditionGroup()
->condition('name', $properties[$langcode]['name'][0], '=', $langcode)
- ->condition("$this->field_name.value", $field_value, '=', $langcode);
+ ->condition("$this->fieldName.value", $field_value, '=', $langcode);
$result = $query
->condition($langcode_key, $default_langcode)
->condition($default_langcode_group)
@@ -681,11 +681,11 @@ class EntityTranslationTest extends EntityLanguageTestBase {
// translatability.
$values = array(
$langcode_key => $langcode,
- $this->field_name => $this->randomMachineName(),
- $this->untranslatable_field_name => $this->randomMachineName(),
+ $this->fieldName => $this->randomMachineName(),
+ $this->untranslatableFieldName => $this->randomMachineName(),
);
$entity = $controller->create($values);
- foreach (array($this->field_name, $this->untranslatable_field_name) as $field_name) {
+ foreach (array($this->fieldName, $this->untranslatableFieldName) as $field_name) {
$this->assertEqual($entity->get($field_name)->getLangcode(), $langcode, 'Field language works as expected.');
}
@@ -693,16 +693,16 @@ class EntityTranslationTest extends EntityLanguageTestBase {
// changing it.
$langcode = $this->langcodes[1];
$entity->{$langcode_key}->value = $langcode;
- foreach (array($this->field_name, $this->untranslatable_field_name) as $field_name) {
+ foreach (array($this->fieldName, $this->untranslatableFieldName) as $field_name) {
$this->assertEqual($entity->get($field_name)->getLangcode(), $langcode, 'Field language works as expected after changing entity language.');
}
// Check that entity translation does not affect the language of original
// field values and untranslatable ones.
$langcode = $this->langcodes[0];
- $entity->addTranslation($this->langcodes[2], array($this->field_name => $this->randomMachineName()));
+ $entity->addTranslation($this->langcodes[2], array($this->fieldName => $this->randomMachineName()));
$entity->{$langcode_key}->value = $langcode;
- foreach (array($this->field_name, $this->untranslatable_field_name) as $field_name) {
+ foreach (array($this->fieldName, $this->untranslatableFieldName) as $field_name) {
$this->assertEqual($entity->get($field_name)->getLangcode(), $langcode, 'Field language works as expected after translating the entity and changing language.');
}
diff --git a/core/modules/system/src/Tests/Entity/EntityValidationTest.php b/core/modules/system/src/Tests/Entity/EntityValidationTest.php
index 96e5d8b..07823fb 100644
--- a/core/modules/system/src/Tests/Entity/EntityValidationTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityValidationTest.php
@@ -24,17 +24,17 @@ class EntityValidationTest extends EntityUnitTestBase {
/**
* @var string
*/
- protected $entity_name;
+ protected $entityName;
/**
* @var \Drupal\user\Entity\User
*/
- protected $entity_user;
+ protected $entityUser;
/**
* @var string
*/
- protected $entity_field_text;
+ protected $entityFieldText;
/**
* {@inheritdoc}
@@ -59,18 +59,18 @@ class EntityValidationTest extends EntityUnitTestBase {
* The created test entity.
*/
protected function createTestEntity($entity_type) {
- $this->entity_name = $this->randomMachineName();
- $this->entity_user = $this->createUser();
- $this->entity_field_text = $this->randomMachineName();
+ $this->entityName = $this->randomMachineName();
+ $this->entityUser = $this->createUser();
+ $this->entityFieldText = $this->randomMachineName();
// Pass in the value of the name field when creating. With the user
// field we test setting a field after creation.
$entity = entity_create($entity_type);
- $entity->user_id->target_id = $this->entity_user->id();
- $entity->name->value = $this->entity_name;
+ $entity->user_id->target_id = $this->entityUser->id();
+ $entity->name->value = $this->entityName;
// Set a value for the test field.
- $entity->field_test_text->value = $this->entity_field_text;
+ $entity->field_test_text->value = $this->entityFieldText;
return $entity;
}
diff --git a/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php b/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
index 688daf2..a6d1f8d 100644
--- a/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
+++ b/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
@@ -34,12 +34,12 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
*
* @var string
*/
- protected $field_name;
+ protected $fieldName;
/**
* @var int
*/
- protected $field_cardinality;
+ protected $fieldCardinality;
/**
* A field storage to use in this class.
@@ -67,14 +67,14 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
*
* @var string
*/
- protected $revision_table;
+ protected $revisionTable;
/**
* The table mapping for the tested entity type.
*
* @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping
*/
- protected $table_mapping;
+ protected $tableMapping;
protected function setUp() {
parent::setUp();
@@ -82,13 +82,13 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
$this->installEntitySchema('entity_test_rev');
$entity_type = 'entity_test_rev';
- $this->field_name = strtolower($this->randomMachineName());
- $this->field_cardinality = 4;
+ $this->fieldName = strtolower($this->randomMachineName());
+ $this->fieldCardinality = 4;
$this->fieldStorage = entity_create('field_storage_config', array(
- 'field_name' => $this->field_name,
+ 'field_name' => $this->fieldName,
'entity_type' => $entity_type,
'type' => 'test_field',
- 'cardinality' => $this->field_cardinality,
+ 'cardinality' => $this->fieldCardinality,
));
$this->fieldStorage->save();
$this->field = entity_create('field_config', array(
@@ -99,9 +99,9 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
/** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
$table_mapping = \Drupal::entityManager()->getStorage($entity_type)->getTableMapping();
- $this->table_mapping = $table_mapping;
+ $this->tableMapping = $table_mapping;
$this->table = $table_mapping->getDedicatedDataTableName($this->fieldStorage);
- $this->revision_table = $table_mapping->getDedicatedRevisionTableName($this->fieldStorage);
+ $this->revisionTable = $table_mapping->getDedicatedRevisionTableName($this->fieldStorage);
}
/**
@@ -111,7 +111,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
$entity_type = $bundle = 'entity_test_rev';
$storage = $this->container->get('entity.manager')->getStorage($entity_type);
- $columns = array('bundle', 'deleted', 'entity_id', 'revision_id', 'delta', 'langcode', $this->table_mapping->getFieldColumnName($this->fieldStorage, 'value'));
+ $columns = array('bundle', 'deleted', 'entity_id', 'revision_id', 'delta', 'langcode', $this->tableMapping->getFieldColumnName($this->fieldStorage, 'value'));
// Create an entity with four revisions.
$revision_ids = array();
@@ -126,10 +126,10 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
// Generate values and insert them directly in the storage tables.
$values = array();
- $query = db_insert($this->revision_table)->fields($columns);
+ $query = db_insert($this->revisionTable)->fields($columns);
foreach ($revision_ids as $revision_id) {
// Put one value too many.
- for ($delta = 0; $delta <= $this->field_cardinality; $delta++) {
+ for ($delta = 0; $delta <= $this->fieldCardinality; $delta++) {
$value = mt_rand(1, 127);
$values[$revision_id][] = $value;
$query->values(array($bundle, 0, $entity->id(), $revision_id, $delta, $entity->language()->getId(), $value));
@@ -146,11 +146,11 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
foreach ($revision_ids as $revision_id) {
$entity = $storage->loadRevision($revision_id);
foreach ($values[$revision_id] as $delta => $value) {
- if ($delta < $this->field_cardinality) {
- $this->assertEqual($entity->{$this->field_name}[$delta]->value, $value);
+ if ($delta < $this->fieldCardinality) {
+ $this->assertEqual($entity->{$this->fieldName}[$delta]->value, $value);
}
else {
- $this->assertFalse(array_key_exists($delta, $entity->{$this->field_name}));
+ $this->assertFalse(array_key_exists($delta, $entity->{$this->fieldName}));
}
}
}
@@ -158,11 +158,11 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
// Load the "current revision" and check the values.
$entity = $storage->load($entity->id());
foreach ($values[$revision_id] as $delta => $value) {
- if ($delta < $this->field_cardinality) {
- $this->assertEqual($entity->{$this->field_name}[$delta]->value, $value);
+ if ($delta < $this->fieldCardinality) {
+ $this->assertEqual($entity->{$this->fieldName}[$delta]->value, $value);
}
else {
- $this->assertFalse(array_key_exists($delta, $entity->{$this->field_name}));
+ $this->assertFalse(array_key_exists($delta, $entity->{$this->fieldName}));
}
}
@@ -171,9 +171,9 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
$unavailable_langcode = 'xx';
$values = array($bundle, 0, $entity->id(), $entity->getRevisionId(), 0, $unavailable_langcode, mt_rand(1, 127));
db_insert($this->table)->fields($columns)->values($values)->execute();
- db_insert($this->revision_table)->fields($columns)->values($values)->execute();
+ db_insert($this->revisionTable)->fields($columns)->values($values)->execute();
$entity = $storage->load($entity->id());
- $this->assertFalse(array_key_exists($unavailable_langcode, $entity->{$this->field_name}));
+ $this->assertFalse(array_key_exists($unavailable_langcode, $entity->{$this->fieldName}));
}
/**
@@ -187,15 +187,15 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
// Check insert. Add one value too many.
$values = array();
- for ($delta = 0; $delta <= $this->field_cardinality; $delta++) {
+ for ($delta = 0; $delta <= $this->fieldCardinality; $delta++) {
$values[$delta]['value'] = mt_rand(1, 127);
}
- $entity->{$this->field_name} = $values;
+ $entity->{$this->fieldName} = $values;
$entity->save();
// Read the tables and check the correct values have been stored.
$rows = db_select($this->table, 't')->fields('t')->execute()->fetchAllAssoc('delta', \PDO::FETCH_ASSOC);
- $this->assertEqual(count($rows), $this->field_cardinality);
+ $this->assertEqual(count($rows), $this->fieldCardinality);
foreach ($rows as $delta => $row) {
$expected = array(
'bundle' => $bundle,
@@ -204,7 +204,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
'revision_id' => $entity->getRevisionId(),
'langcode' => $entity->language()->getId(),
'delta' => $delta,
- $this->field_name . '_value' => $values[$delta]['value'],
+ $this->fieldName . '_value' => $values[$delta]['value'],
);
$this->assertEqual($row, $expected, "Row $delta was stored as expected.");
}
@@ -212,10 +212,10 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
// Test update. Add less values and check that the previous values did not
// persist.
$values = array();
- for ($delta = 0; $delta <= $this->field_cardinality - 2; $delta++) {
+ for ($delta = 0; $delta <= $this->fieldCardinality - 2; $delta++) {
$values[$delta]['value'] = mt_rand(1, 127);
}
- $entity->{$this->field_name} = $values;
+ $entity->{$this->fieldName} = $values;
$entity->save();
$rows = db_select($this->table, 't')->fields('t')->execute()->fetchAllAssoc('delta', \PDO::FETCH_ASSOC);
$this->assertEqual(count($rows), count($values));
@@ -227,7 +227,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
'revision_id' => $entity->getRevisionId(),
'langcode' => $entity->language()->getId(),
'delta' => $delta,
- $this->field_name . '_value' => $values[$delta]['value'],
+ $this->fieldName . '_value' => $values[$delta]['value'],
);
$this->assertEqual($row, $expected, "Row $delta was stored as expected.");
}
@@ -235,18 +235,18 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
// Create a new revision.
$revision_values[$entity->getRevisionId()] = $values;
$values = array();
- for ($delta = 0; $delta < $this->field_cardinality; $delta++) {
+ for ($delta = 0; $delta < $this->fieldCardinality; $delta++) {
$values[$delta]['value'] = mt_rand(1, 127);
}
- $entity->{$this->field_name} = $values;
+ $entity->{$this->fieldName} = $values;
$entity->setNewRevision();
$entity->save();
$revision_values[$entity->getRevisionId()] = $values;
// Check that data for both revisions are in the revision table.
foreach ($revision_values as $revision_id => $values) {
- $rows = db_select($this->revision_table, 't')->fields('t')->condition('revision_id', $revision_id)->execute()->fetchAllAssoc('delta', \PDO::FETCH_ASSOC);
- $this->assertEqual(count($rows), min(count($values), $this->field_cardinality));
+ $rows = db_select($this->revisionTable, 't')->fields('t')->condition('revision_id', $revision_id)->execute()->fetchAllAssoc('delta', \PDO::FETCH_ASSOC);
+ $this->assertEqual(count($rows), min(count($values), $this->fieldCardinality));
foreach ($rows as $delta => $row) {
$expected = array(
'bundle' => $bundle,
@@ -255,14 +255,14 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
'revision_id' => $revision_id,
'langcode' => $entity->language()->getId(),
'delta' => $delta,
- $this->field_name . '_value' => $values[$delta]['value'],
+ $this->fieldName . '_value' => $values[$delta]['value'],
);
$this->assertEqual($row, $expected, "Row $delta was stored as expected.");
}
}
// Test emptying the field.
- $entity->{$this->field_name} = NULL;
+ $entity->{$this->fieldName} = NULL;
$entity->save();
$rows = db_select($this->table, 't')->fields('t')->execute()->fetchAllAssoc('delta', \PDO::FETCH_ASSOC);
$this->assertEqual(count($rows), 0);
@@ -368,8 +368,8 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
// Ensure that the field tables are still there.
$tables = array(
- $this->table_mapping->getDedicatedDataTableName($prior_field_storage),
- $this->table_mapping->getDedicatedRevisionTableName($prior_field_storage),
+ $this->tableMapping->getDedicatedDataTableName($prior_field_storage),
+ $this->tableMapping->getDedicatedRevisionTableName($prior_field_storage),
);
foreach ($tables as $table_name) {
$this->assertTrue(db_table_exists($table_name), t('Table %table exists.', array('%table' => $table_name)));
@@ -394,7 +394,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
'bundle' => $entity_type,
));
$field->save();
- $tables = array($this->table_mapping->getDedicatedDataTableName($field_storage), $this->table_mapping->getDedicatedRevisionTableName($field_storage));
+ $tables = array($this->tableMapping->getDedicatedDataTableName($field_storage), $this->tableMapping->getDedicatedRevisionTableName($field_storage));
// Verify the indexes we will create do not exist yet.
foreach ($tables as $table) {
@@ -511,9 +511,9 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
'type' => 'test_field',
));
$expected = 'short_entity_type__short_field_name';
- $this->assertEqual($this->table_mapping->getDedicatedDataTableName($field_storage), $expected);
+ $this->assertEqual($this->tableMapping->getDedicatedDataTableName($field_storage), $expected);
$expected = 'short_entity_type_revision__short_field_name';
- $this->assertEqual($this->table_mapping->getDedicatedRevisionTableName($field_storage), $expected);
+ $this->assertEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage), $expected);
// Short entity type, long field name
$entity_type = 'short_entity_type';
@@ -524,9 +524,9 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
'type' => 'test_field',
));
$expected = 'short_entity_type__' . substr(hash('sha256', $field_storage->uuid()), 0, 10);
- $this->assertEqual($this->table_mapping->getDedicatedDataTableName($field_storage), $expected);
+ $this->assertEqual($this->tableMapping->getDedicatedDataTableName($field_storage), $expected);
$expected = 'short_entity_type_r__' . substr(hash('sha256', $field_storage->uuid()), 0, 10);
- $this->assertEqual($this->table_mapping->getDedicatedRevisionTableName($field_storage), $expected);
+ $this->assertEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage), $expected);
// Long entity type, short field name
$entity_type = 'long_entity_type_abcdefghijklmnopqrstuvwxyz';
@@ -537,9 +537,9 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
'type' => 'test_field',
));
$expected = 'long_entity_type_abcdefghijklmnopq__' . substr(hash('sha256', $field_storage->uuid()), 0, 10);
- $this->assertEqual($this->table_mapping->getDedicatedDataTableName($field_storage), $expected);
+ $this->assertEqual($this->tableMapping->getDedicatedDataTableName($field_storage), $expected);
$expected = 'long_entity_type_abcdefghijklmnopq_r__' . substr(hash('sha256', $field_storage->uuid()), 0, 10);
- $this->assertEqual($this->table_mapping->getDedicatedRevisionTableName($field_storage), $expected);
+ $this->assertEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage), $expected);
// Long entity type and field name.
$entity_type = 'long_entity_type_abcdefghijklmnopqrstuvwxyz';
@@ -550,17 +550,17 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
'type' => 'test_field',
));
$expected = 'long_entity_type_abcdefghijklmnopq__' . substr(hash('sha256', $field_storage->uuid()), 0, 10);
- $this->assertEqual($this->table_mapping->getDedicatedDataTableName($field_storage), $expected);
+ $this->assertEqual($this->tableMapping->getDedicatedDataTableName($field_storage), $expected);
$expected = 'long_entity_type_abcdefghijklmnopq_r__' . substr(hash('sha256', $field_storage->uuid()), 0, 10);
- $this->assertEqual($this->table_mapping->getDedicatedRevisionTableName($field_storage), $expected);
+ $this->assertEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage), $expected);
// Try creating a second field and check there are no clashes.
$field_storage2 = entity_create('field_storage_config', array(
'entity_type' => $entity_type,
'field_name' => $field_name . '2',
'type' => 'test_field',
));
- $this->assertNotEqual($this->table_mapping->getDedicatedDataTableName($field_storage), $this->table_mapping->getDedicatedDataTableName($field_storage2));
- $this->assertNotEqual($this->table_mapping->getDedicatedRevisionTableName($field_storage), $this->table_mapping->getDedicatedRevisionTableName($field_storage2));
+ $this->assertNotEqual($this->tableMapping->getDedicatedDataTableName($field_storage), $this->tableMapping->getDedicatedDataTableName($field_storage2));
+ $this->assertNotEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage), $this->tableMapping->getDedicatedRevisionTableName($field_storage2));
// Deleted field.
$field_storage = entity_create('field_storage_config', array(
@@ -570,9 +570,9 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
'deleted' => TRUE,
));
$expected = 'field_deleted_data_' . substr(hash('sha256', $field_storage->uuid()), 0, 10);
- $this->assertEqual($this->table_mapping->getDedicatedDataTableName($field_storage, TRUE), $expected);
+ $this->assertEqual($this->tableMapping->getDedicatedDataTableName($field_storage, TRUE), $expected);
$expected = 'field_deleted_revision_' . substr(hash('sha256', $field_storage->uuid()), 0, 10);
- $this->assertEqual($this->table_mapping->getDedicatedRevisionTableName($field_storage, TRUE), $expected);
+ $this->assertEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage, TRUE), $expected);
}
}
diff --git a/core/modules/system/src/Tests/Entity/FieldTranslationSqlStorageTest.php b/core/modules/system/src/Tests/Entity/FieldTranslationSqlStorageTest.php
index 68c5063..af3461e 100644
--- a/core/modules/system/src/Tests/Entity/FieldTranslationSqlStorageTest.php
+++ b/core/modules/system/src/Tests/Entity/FieldTranslationSqlStorageTest.php
@@ -26,8 +26,8 @@ class FieldTranslationSqlStorageTest extends EntityLanguageTestBase {
$controller = $this->entityManager->getStorage($entity_type);
$values = array(
- $this->field_name => $this->randomMachineName(),
- $this->untranslatable_field_name => $this->randomMachineName(),
+ $this->fieldName => $this->randomMachineName(),
+ $this->untranslatableFieldName => $this->randomMachineName(),
);
$entity = $controller->create($values);
$entity->save();
@@ -50,7 +50,7 @@ class FieldTranslationSqlStorageTest extends EntityLanguageTestBase {
// before.
$this->toggleFieldTranslatability($entity_type, $entity_type);
$entity = $this->reloadEntity($entity);
- foreach (array($this->field_name, $this->untranslatable_field_name) as $field_name) {
+ foreach (array($this->fieldName, $this->untranslatableFieldName) as $field_name) {
$this->assertEqual($entity->get($field_name)->value, $values[$field_name], 'Field language works as expected after switching translatability.');
}
@@ -61,11 +61,11 @@ class FieldTranslationSqlStorageTest extends EntityLanguageTestBase {
$entity->langcode->value = $this->langcodes[0];
$translation = $entity->addTranslation($this->langcodes[1]);
$translated_value = $this->randomMachineName();
- $translation->get($this->field_name)->value = $translated_value;
+ $translation->get($this->fieldName)->value = $translated_value;
$translation->save();
$this->toggleFieldTranslatability($entity_type, $entity_type);
$entity = $this->reloadEntity($entity);
- $this->assertEqual($entity->getTranslation($this->langcodes[1])->get($this->field_name)->value, $values[$this->field_name], 'Existing field translations are not loaded for untranslatable fields.');
+ $this->assertEqual($entity->getTranslation($this->langcodes[1])->get($this->fieldName)->value, $values[$this->fieldName], 'Existing field translations are not loaded for untranslatable fields.');
}
/**
@@ -81,7 +81,7 @@ class FieldTranslationSqlStorageTest extends EntityLanguageTestBase {
$entity_type = $entity->getEntityTypeId();
$id = $entity->id();
$langcode = $entity->getUntranslated()->language()->getId();
- $fields = array($this->field_name, $this->untranslatable_field_name);
+ $fields = array($this->fieldName, $this->untranslatableFieldName);
/** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
$table_mapping = \Drupal::entityManager()->getStorage($entity_type)->getTableMapping();
diff --git a/core/modules/system/src/Tests/File/ConfigTest.php b/core/modules/system/src/Tests/File/ConfigTest.php
index 4eb7bf1..183d95a 100644
--- a/core/modules/system/src/Tests/File/ConfigTest.php
+++ b/core/modules/system/src/Tests/File/ConfigTest.php
@@ -18,8 +18,7 @@ class ConfigTest extends WebTestBase {
protected function setUp(){
parent::setUp();
- $this->web_user = $this->drupalCreateUser(array('administer site configuration'));
- $this->drupalLogin($this->web_user);
+ $this->drupalLogin ($this->drupalCreateUser(array('administer site configuration')));
}
/**
diff --git a/core/modules/system/src/Tests/File/NameMungingTest.php b/core/modules/system/src/Tests/File/NameMungingTest.php
index 06f44c8..cf3fd89 100644
--- a/core/modules/system/src/Tests/File/NameMungingTest.php
+++ b/core/modules/system/src/Tests/File/NameMungingTest.php
@@ -17,7 +17,7 @@ class NameMungingTest extends FileTestBase {
/**
* @var string
*/
- protected $bad_extension;
+ protected $badExtension;
/**
* @var string
@@ -27,13 +27,13 @@ class NameMungingTest extends FileTestBase {
/**
* @var string
*/
- protected $name_with_uc_ext;
+ protected $nameWithUcExt;
protected function setUp() {
parent::setUp();
- $this->bad_extension = 'php';
- $this->name = $this->randomMachineName() . '.' . $this->bad_extension . '.txt';
- $this->name_with_uc_ext = $this->randomMachineName() . '.' . strtoupper($this->bad_extension) . '.txt';
+ $this->badExtension = 'php';
+ $this->name = $this->randomMachineName() . '.' . $this->badExtension . '.txt';
+ $this->nameWithUcExt = $this->randomMachineName() . '.' . strtoupper($this->badExtension) . '.txt';
}
/**
@@ -53,8 +53,8 @@ class NameMungingTest extends FileTestBase {
*/
function testMungeNullByte() {
$prefix = $this->randomMachineName();
- $filename = $prefix . '.' . $this->bad_extension . "\0.txt";
- $this->assertEqual(file_munge_filename($filename, ''), $prefix . '.' . $this->bad_extension . '_.txt', 'A filename with a null byte is correctly munged to remove the null byte.');
+ $filename = $prefix . '.' . $this->badExtension . "\0.txt";
+ $this->assertEqual(file_munge_filename($filename, ''), $prefix . '.' . $this->badExtension . '_.txt', 'A filename with a null byte is correctly munged to remove the null byte.');
}
/**
@@ -73,10 +73,10 @@ class NameMungingTest extends FileTestBase {
function testMungeIgnoreWhitelisted() {
// Declare our extension as whitelisted. The declared extensions should
// be case insensitive so test using one with a different case.
- $munged_name = file_munge_filename($this->name_with_uc_ext, $this->bad_extension);
- $this->assertIdentical($munged_name, $this->name_with_uc_ext, format_string('The new filename (%munged) matches the original (%original) once the extension has been whitelisted.', array('%munged' => $munged_name, '%original' => $this->name_with_uc_ext)));
+ $munged_name = file_munge_filename($this->nameWithUcExt, $this->badExtension);
+ $this->assertIdentical($munged_name, $this->nameWithUcExt, format_string('The new filename (%munged) matches the original (%original) once the extension has been whitelisted.', array('%munged' => $munged_name, '%original' => $this->nameWithUcExt)));
// The allowed extensions should also be normalized.
- $munged_name = file_munge_filename($this->name, strtoupper($this->bad_extension));
+ $munged_name = file_munge_filename($this->name, strtoupper($this->badExtension));
$this->assertIdentical($munged_name, $this->name, format_string('The new filename (%munged) matches the original (%original) also when the whitelisted extension is in uppercase.', array('%munged' => $munged_name, '%original' => $this->name)));
}
diff --git a/core/modules/system/src/Tests/FileTransfer/MockTestConnection.php b/core/modules/system/src/Tests/FileTransfer/MockTestConnection.php
index b1b787a..55548ad 100644
--- a/core/modules/system/src/Tests/FileTransfer/MockTestConnection.php
+++ b/core/modules/system/src/Tests/FileTransfer/MockTestConnection.php
@@ -12,8 +12,8 @@ namespace Drupal\system\Tests\FileTransfer;
*/
class MockTestConnection {
- var $commandsRun = array();
- var $connectionString;
+ protected $commandsRun = array();
+ public $connectionString;
function run($cmd) {
$this->commandsRun[] = $cmd;
diff --git a/core/modules/system/src/Tests/Form/ElementsVerticalTabsTest.php b/core/modules/system/src/Tests/Form/ElementsVerticalTabsTest.php
index 29610f0..44f331f 100644
--- a/core/modules/system/src/Tests/Form/ElementsVerticalTabsTest.php
+++ b/core/modules/system/src/Tests/Form/ElementsVerticalTabsTest.php
@@ -25,12 +25,26 @@ class ElementsVerticalTabsTest extends WebTestBase {
*/
public static $modules = array('form_test');
+ /**
+ * A user with permission to access vertical_tab_test_tabs.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ protected $adminUser;
+
+ /**
+ * A normal user.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ protected $webUser;
+
protected function setUp() {
parent::setUp();
- $this->admin_user = $this->drupalCreateUser(array('access vertical_tab_test tabs'));
- $this->web_user = $this->drupalCreateUser();
- $this->drupalLogin($this->admin_user);
+ $this->adminUser = $this->drupalCreateUser(array('access vertical_tab_test tabs'));
+ $this->webUser = $this->drupalCreateUser();
+ $this->drupalLogin($this->adminUser);
}
/**
@@ -55,7 +69,7 @@ class ElementsVerticalTabsTest extends WebTestBase {
$this->assertTrue(isset($wrapper[0]), 'Vertical tab panes found.');
// Test wrapper markup not present for non-privileged web user.
- $this->drupalLogin($this->web_user);
+ $this->drupalLogin($this->webUser);
$this->drupalGet('form_test/vertical-tabs');
$wrapper = $this->xpath("//div[@data-vertical-tabs-panes]");
$this->assertFalse(isset($wrapper[0]), 'Vertical tab wrappers are not displayed to unprivileged users.');
diff --git a/core/modules/system/src/Tests/Form/FormCacheTest.php b/core/modules/system/src/Tests/Form/FormCacheTest.php
index fbbb0f4..77d259e 100644
--- a/core/modules/system/src/Tests/Form/FormCacheTest.php
+++ b/core/modules/system/src/Tests/Form/FormCacheTest.php
@@ -30,7 +30,7 @@ class FormCacheTest extends KernelTestBase {
/**
* @var string
*/
- protected $form_build_id;
+ protected $formBuildId;
/**
* @var array
@@ -40,18 +40,18 @@ class FormCacheTest extends KernelTestBase {
/**
* @var array
*/
- protected $form_state;
+ protected $formState;
protected function setUp() {
parent::setUp();
$this->installSchema('system', array('key_value_expire'));
- $this->form_build_id = $this->randomMachineName();
+ $this->formBuildId = $this->randomMachineName();
$this->form = array(
'#property' => $this->randomMachineName(),
);
- $this->form_state = new FormState();
- $this->form_state->set('example', $this->randomMachineName());
+ $this->formState = new FormState();
+ $this->formState->set('example', $this->randomMachineName());
}
/**
@@ -59,20 +59,20 @@ class FormCacheTest extends KernelTestBase {
*/
function testCacheToken() {
\Drupal::currentUser()->setAccount(new UserSession(array('uid' => 1)));
- \Drupal::formBuilder()->setCache($this->form_build_id, $this->form, $this->form_state);
+ \Drupal::formBuilder()->setCache($this->formBuildId, $this->form, $this->formState);
$cached_form_state = new FormState();
- $cached_form = \Drupal::formBuilder()->getCache($this->form_build_id, $cached_form_state);
+ $cached_form = \Drupal::formBuilder()->getCache($this->formBuildId, $cached_form_state);
$this->assertEqual($this->form['#property'], $cached_form['#property']);
$this->assertTrue(!empty($cached_form['#cache_token']), 'Form has a cache token');
- $this->assertEqual($this->form_state->get('example'), $cached_form_state->get('example'));
+ $this->assertEqual($this->formState->get('example'), $cached_form_state->get('example'));
// Test that the form cache isn't loaded when the session/token has changed.
// Change the private key. (We cannot change the session ID because this
// will break the parent site test runner batch.)
\Drupal::state()->set('system.private_key', 'invalid');
$cached_form_state = new FormState();
- $cached_form = \Drupal::formBuilder()->getCache($this->form_build_id, $cached_form_state);
+ $cached_form = \Drupal::formBuilder()->getCache($this->formBuildId, $cached_form_state);
$this->assertFalse($cached_form, 'No form returned from cache');
$cached_form_state_example = $cached_form_state->get('example');
$this->assertTrue(empty($cached_form_state_example));
@@ -93,14 +93,14 @@ class FormCacheTest extends KernelTestBase {
$account_switcher = \Drupal::service('account_switcher');
$account_switcher->switchTo(new AnonymousUserSession());
- $this->form_state->set('example', $this->randomMachineName());
- \Drupal::formBuilder()->setCache($this->form_build_id, $this->form, $this->form_state);
+ $this->formState->set('example', $this->randomMachineName());
+ \Drupal::formBuilder()->setCache($this->formBuildId, $this->form, $this->formState);
$cached_form_state = new FormState();
- $cached_form = \Drupal::formBuilder()->getCache($this->form_build_id, $cached_form_state);
+ $cached_form = \Drupal::formBuilder()->getCache($this->formBuildId, $cached_form_state);
$this->assertEqual($this->form['#property'], $cached_form['#property']);
$this->assertTrue(empty($cached_form['#cache_token']), 'Form has no cache token');
- $this->assertEqual($this->form_state->get('example'), $cached_form_state->get('example'));
+ $this->assertEqual($this->formState->get('example'), $cached_form_state->get('example'));
// Restore user account.
$account_switcher->switchBack();
diff --git a/core/modules/system/src/Tests/Form/RebuildTest.php b/core/modules/system/src/Tests/Form/RebuildTest.php
index eb80652..e993b49 100644
--- a/core/modules/system/src/Tests/Form/RebuildTest.php
+++ b/core/modules/system/src/Tests/Form/RebuildTest.php
@@ -26,13 +26,20 @@ class RebuildTest extends WebTestBase {
*/
public static $modules = array('node', 'form_test');
+ /**
+ * A user for testing.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ protected $webUser;
+
protected function setUp() {
parent::setUp();
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
- $this->web_user = $this->drupalCreateUser(array('access content'));
- $this->drupalLogin($this->web_user);
+ $this->webUser = $this->drupalCreateUser(array('access content'));
+ $this->drupalLogin($this->webUser);
}
/**
@@ -82,8 +89,8 @@ class RebuildTest extends WebTestBase {
->save();
// Log in a user who can create 'page' nodes.
- $this->web_user = $this->drupalCreateUser(array('create page content'));
- $this->drupalLogin($this->web_user);
+ $this->webUser = $this->drupalCreateUser(array('create page content'));
+ $this->drupalLogin($this->webUser);
// Get the form for adding a 'page' node. Submit an "add another item" Ajax
// submission and verify it worked by ensuring the updated page has two text
diff --git a/core/modules/system/src/Tests/Form/StorageTest.php b/core/modules/system/src/Tests/Form/StorageTest.php
index 9e99ec3..f77c567 100644
--- a/core/modules/system/src/Tests/Form/StorageTest.php
+++ b/core/modules/system/src/Tests/Form/StorageTest.php
@@ -33,8 +33,7 @@ class StorageTest extends WebTestBase {
protected function setUp() {
parent::setUp();
- $this->web_user = $this->drupalCreateUser();
- $this->drupalLogin($this->web_user);
+ $this->drupalLogin ($this->drupalCreateUser());
}
/**
diff --git a/core/modules/system/src/Tests/Image/ToolkitGdTest.php b/core/modules/system/src/Tests/Image/ToolkitGdTest.php
index c45bee3..9b25182 100644
--- a/core/modules/system/src/Tests/Image/ToolkitGdTest.php
+++ b/core/modules/system/src/Tests/Image/ToolkitGdTest.php
@@ -36,7 +36,7 @@ class ToolkitGdTest extends KernelTestBase {
protected $transparent = array(0, 0, 0, 127);
// Used as rotate background colors.
protected $fuchsia = array(255, 0, 255, 0);
- protected $rotate_transparent = array(255, 255, 255, 127);
+ protected $rotateTransparent = array(255, 255, 255, 127);
protected $width = 40;
protected $height = 20;
@@ -219,7 +219,7 @@ class ToolkitGdTest extends KernelTestBase {
'arguments' => array('degrees' => 5),
'width' => 42,
'height' => 24,
- 'corners' => array_fill(0, 4, $this->rotate_transparent),
+ 'corners' => array_fill(0, 4, $this->rotateTransparent),
),
'rotate_transparent_90' => array(
'function' => 'rotate',
diff --git a/core/modules/system/src/Tests/Image/ToolkitSetupFormTest.php b/core/modules/system/src/Tests/Image/ToolkitSetupFormTest.php
index 1317040..2422e38 100644
--- a/core/modules/system/src/Tests/Image/ToolkitSetupFormTest.php
+++ b/core/modules/system/src/Tests/Image/ToolkitSetupFormTest.php
@@ -21,7 +21,7 @@ class ToolkitSetupFormTest extends WebTestBase {
*
* @var \Drupal\user\Entity\User
*/
- protected $admin_user;
+ protected $adminUser;
/**
* Modules to enable.
@@ -35,10 +35,10 @@ class ToolkitSetupFormTest extends WebTestBase {
*/
protected function setUp() {
parent::setUp();
- $this->admin_user = $this->drupalCreateUser(array(
+ $this->adminUser = $this->drupalCreateUser(array(
'administer site configuration',
));
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
}
/**
diff --git a/core/modules/system/src/Tests/Mail/MailTest.php b/core/modules/system/src/Tests/Mail/MailTest.php
index 3603332..469f82e 100644
--- a/core/modules/system/src/Tests/Mail/MailTest.php
+++ b/core/modules/system/src/Tests/Mail/MailTest.php
@@ -26,14 +26,6 @@ class MailTest extends WebTestBase {
public static $modules = array('simpletest', 'system_mail_failure_test');
/**
- * The most recent message that was sent through the test case.
- *
- * We take advantage here of the fact that static variables are shared among
- * all instance of the same class.
- */
- private static $sent_message;
-
- /**
* Assert that the pluggable mail system is functional.
*/
public function testPluggableFramework() {
diff --git a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php
index 96d6277..4b3d531 100644
--- a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php
+++ b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php
@@ -26,6 +26,20 @@ class BreadcrumbTest extends MenuTestBase {
public static $modules = array('menu_test', 'block');
/**
+ * An administrative user.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ protected $adminUser;
+
+ /**
+ * A regular user.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ protected $webUser;
+
+ /**
* Test paths in the Standard profile.
*/
protected $profile = 'standard';
@@ -34,8 +48,8 @@ class BreadcrumbTest extends MenuTestBase {
parent::setUp();
$perms = array_keys(\Drupal::service('user.permissions')->getPermissions());
- $this->admin_user = $this->drupalCreateUser($perms);
- $this->drupalLogin($this->admin_user);
+ $this->adminUser = $this->drupalCreateUser($perms);
+ $this->drupalLogin($this->adminUser);
// This test puts menu links in the Tools menu and then tests for their
// presence on the page, so we need to ensure that the Tools block will be
@@ -302,47 +316,47 @@ class BreadcrumbTest extends MenuTestBase {
// Verify breadcrumb on user pages (without menu link) for anonymous user.
$trail = $home;
$this->assertBreadcrumb('user', $trail, t('Log in'));
- $this->assertBreadcrumb('user/' . $this->admin_user->id(), $trail, $this->admin_user->getUsername());
+ $this->assertBreadcrumb('user/' . $this->adminUser->id(), $trail, $this->adminUser->getUsername());
// Verify breadcrumb on user pages (without menu link) for registered users.
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
$trail = $home;
- $this->assertBreadcrumb('user', $trail, $this->admin_user->getUsername());
- $this->assertBreadcrumb('user/' . $this->admin_user->id(), $trail, $this->admin_user->getUsername());
+ $this->assertBreadcrumb('user', $trail, $this->adminUser->getUsername());
+ $this->assertBreadcrumb('user/' . $this->adminUser->id(), $trail, $this->adminUser->getUsername());
$trail += array(
- 'user/' . $this->admin_user->id() => $this->admin_user->getUsername(),
+ 'user/' . $this->adminUser->id() => $this->adminUser->getUsername(),
);
- $this->assertBreadcrumb('user/' . $this->admin_user->id() . '/edit', $trail, $this->admin_user->getUsername());
+ $this->assertBreadcrumb('user/' . $this->adminUser->id() . '/edit', $trail, $this->adminUser->getUsername());
// Create a second user to verify breadcrumb on user pages again.
- $this->web_user = $this->drupalCreateUser(array(
+ $this->webUser = $this->drupalCreateUser(array(
'administer users',
'access user profiles',
));
- $this->drupalLogin($this->web_user);
+ $this->drupalLogin($this->webUser);
// Verify correct breadcrumb and page title on another user's account pages.
$trail = $home;
- $this->assertBreadcrumb('user/' . $this->admin_user->id(), $trail, $this->admin_user->getUsername());
+ $this->assertBreadcrumb('user/' . $this->adminUser->id(), $trail, $this->adminUser->getUsername());
$trail += array(
- 'user/' . $this->admin_user->id() => $this->admin_user->getUsername(),
+ 'user/' . $this->adminUser->id() => $this->adminUser->getUsername(),
);
- $this->assertBreadcrumb('user/' . $this->admin_user->id() . '/edit', $trail, $this->admin_user->getUsername());
+ $this->assertBreadcrumb('user/' . $this->adminUser->id() . '/edit', $trail, $this->adminUser->getUsername());
// Verify correct breadcrumb and page title when viewing own user account.
$trail = $home;
- $this->assertBreadcrumb('user/' . $this->web_user->id(), $trail, $this->web_user->getUsername());
+ $this->assertBreadcrumb('user/' . $this->webUser->id(), $trail, $this->webUser->getUsername());
$trail += array(
- 'user/' . $this->web_user->id() => $this->web_user->getUsername(),
+ 'user/' . $this->webUser->id() => $this->webUser->getUsername(),
);
- $this->assertBreadcrumb('user/' . $this->web_user->id() . '/edit', $trail, $this->web_user->getUsername());
+ $this->assertBreadcrumb('user/' . $this->webUser->id() . '/edit', $trail, $this->webUser->getUsername());
// Create an only slightly privileged user being able to access site reports
// but not administration pages.
- $this->web_user = $this->drupalCreateUser(array(
+ $this->webUser = $this->drupalCreateUser(array(
'access site reports',
));
- $this->drupalLogin($this->web_user);
+ $this->drupalLogin($this->webUser);
// Verify that we can access recent log entries, there is a corresponding
// page title, and that the breadcrumb is just the Home link (because the
diff --git a/core/modules/system/src/Tests/Menu/MenuRouterTest.php b/core/modules/system/src/Tests/Menu/MenuRouterTest.php
index d9e943c..c8ca38c 100644
--- a/core/modules/system/src/Tests/Menu/MenuRouterTest.php
+++ b/core/modules/system/src/Tests/Menu/MenuRouterTest.php
@@ -22,21 +22,21 @@ class MenuRouterTest extends WebTestBase {
*
* @var array
*/
- public static $modules = array('block', 'menu_test', 'test_page_test');
+ public static $modules = ['block', 'menu_test', 'test_page_test'];
/**
* Name of the administrative theme to use for tests.
*
* @var string
*/
- protected $admin_theme;
+ protected $adminTheme;
/**
* Name of the default theme to use for tests.
*
* @var string
*/
- protected $default_theme;
+ protected $defaultTheme;
protected function setUp() {
// Enable dummy module that implements hook_menu.
@@ -240,14 +240,14 @@ class MenuRouterTest extends WebTestBase {
* Tests theme integration.
*/
public function testThemeIntegration() {
- $this->default_theme = 'bartik';
- $this->admin_theme = 'seven';
+ $this->defaultTheme = 'bartik';
+ $this->adminTheme = 'seven';
$theme_handler = $this->container->get('theme_handler');
- $theme_handler->install(array($this->default_theme, $this->admin_theme));
+ $theme_handler->install([$this->defaultTheme, $this->adminTheme]);
$this->config('system.theme')
- ->set('default', $this->default_theme)
- ->set('admin', $this->admin_theme)
+ ->set('default', $this->defaultTheme)
+ ->set('admin', $this->adminTheme)
->save();
$this->doTestThemeCallbackMaintenanceMode();
diff --git a/core/modules/system/src/Tests/Module/ModuleTestBase.php b/core/modules/system/src/Tests/Module/ModuleTestBase.php
index 4023b57..66a08b2 100644
--- a/core/modules/system/src/Tests/Module/ModuleTestBase.php
+++ b/core/modules/system/src/Tests/Module/ModuleTestBase.php
@@ -25,13 +25,13 @@ abstract class ModuleTestBase extends WebTestBase {
*/
public static $modules = array('system_test');
- protected $admin_user;
+ protected $adminUser;
protected function setUp() {
parent::setUp();
- $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer modules'));
- $this->drupalLogin($this->admin_user);
+ $this->adminUser = $this->drupalCreateUser(array('access administration pages', 'administer modules'));
+ $this->drupalLogin($this->adminUser);
}
/**
diff --git a/core/modules/system/src/Tests/Pager/PagerTest.php b/core/modules/system/src/Tests/Pager/PagerTest.php
index e3269fe..d7dd6b6 100644
--- a/core/modules/system/src/Tests/Pager/PagerTest.php
+++ b/core/modules/system/src/Tests/Pager/PagerTest.php
@@ -23,6 +23,13 @@ class PagerTest extends WebTestBase {
*/
public static $modules = array('dblog', 'pager_test');
+ /**
+ * A user with permission to access site reports.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ protected $adminUser;
+
protected $profile = 'testing';
protected function setUp() {
@@ -34,10 +41,10 @@ class PagerTest extends WebTestBase {
$logger->debug($this->randomString());
}
- $this->admin_user = $this->drupalCreateUser(array(
+ $this->adminUser = $this->drupalCreateUser(array(
'access site reports',
));
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
}
/**
diff --git a/core/modules/system/src/Tests/System/AccessDeniedTest.php b/core/modules/system/src/Tests/System/AccessDeniedTest.php
index 1765648..17cb9d5 100644
--- a/core/modules/system/src/Tests/System/AccessDeniedTest.php
+++ b/core/modules/system/src/Tests/System/AccessDeniedTest.php
@@ -22,15 +22,15 @@ class AccessDeniedTest extends WebTestBase {
*
* @var array
*/
- public static $modules = array('block');
+ public static $modules = ['block'];
- protected $admin_user;
+ protected $adminUser;
protected function setUp() {
parent::setUp();
// Create an administrative user.
- $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer site configuration', 'link to any page', 'administer blocks'));
+ $this->adminUser = $this->drupalCreateUser(['access administration pages', 'administer site configuration', 'link to any page', 'administer blocks']);
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, array('access user profiles'));
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, array('access user profiles'));
@@ -42,10 +42,10 @@ class AccessDeniedTest extends WebTestBase {
$this->assertResponse(403);
// Use a custom 403 page.
- $this->drupalLogin($this->admin_user);
- $edit = array(
- 'site_403' => 'user/' . $this->admin_user->id(),
- );
+ $this->drupalLogin($this->adminUser);
+ $edit = [
+ 'site_403' => 'user/' . $this->adminUser->id(),
+ ];
$this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration'));
// Enable the user login block.
@@ -54,14 +54,14 @@ class AccessDeniedTest extends WebTestBase {
// Log out and check that the user login block is shown on custom 403 pages.
$this->drupalLogout();
$this->drupalGet('admin');
- $this->assertText($this->admin_user->getUsername(), 'Found the custom 403 page');
+ $this->assertText($this->adminUser->getUsername(), 'Found the custom 403 page');
$this->assertText(t('Username'), 'Blocks are shown on the custom 403 page');
// Log back in and remove the custom 403 page.
- $this->drupalLogin($this->admin_user);
- $edit = array(
+ $this->drupalLogin($this->adminUser);
+ $edit = [
'site_403' => '',
- );
+ ];
$this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration'));
// Logout and check that the user login block is shown on default 403 pages.
@@ -72,18 +72,18 @@ class AccessDeniedTest extends WebTestBase {
$this->assertText(t('Username'), 'Blocks are shown on the default 403 page');
// Log back in, set the custom 403 page to /user/login and remove the block
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
$this->config('system.site')->set('page.403', 'user/login')->save();
- $edit = array(
+ $edit = [
'region' => -1,
- );
+ ];
$this->drupalPostForm('admin/structure/block/manage/login', $edit, t('Save block'));
// Check that we can log in from the 403 page.
$this->drupalLogout();
$edit = array(
- 'name' => $this->admin_user->getUsername(),
- 'pass' => $this->admin_user->pass_raw,
+ 'name' => $this->adminUser->getUsername(),
+ 'pass' => $this->adminUser->pass_raw,
);
$this->drupalPostForm('admin/config/system/site-information', $edit, t('Log in'));
diff --git a/core/modules/system/src/Tests/System/AdminTest.php b/core/modules/system/src/Tests/System/AdminTest.php
index fee3cd9..ab14e8f 100644
--- a/core/modules/system/src/Tests/System/AdminTest.php
+++ b/core/modules/system/src/Tests/System/AdminTest.php
@@ -22,14 +22,14 @@ class AdminTest extends WebTestBase {
*
* @var \Drupal\Core\Session\AccountInterface
*/
- protected $admin_user;
+ protected $adminUser;
/**
* User account with limited access to administration pages.
*
* @var \Drupal\Core\Session\AccountInterface
*/
- protected $web_user;
+ protected $webUser;
/**
* Modules to enable.
@@ -45,12 +45,12 @@ class AdminTest extends WebTestBase {
// Create an administrator with all permissions, as well as a regular user
// who can only access administration pages and perform some Locale module
// administrative tasks, but not all of them.
- $this->admin_user = $this->drupalCreateUser(array_keys(\Drupal::service('user.permissions')->getPermissions()));
- $this->web_user = $this->drupalCreateUser(array(
+ $this->adminUser = $this->drupalCreateUser(array_keys(\Drupal::service('user.permissions')->getPermissions()));
+ $this->webUser = $this->drupalCreateUser(array(
'access administration pages',
'translate interface',
));
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
}
/**
@@ -84,7 +84,7 @@ class AdminTest extends WebTestBase {
// For the administrator, verify that there are links to Locale's primary
// configuration pages, but no links to individual sub-configuration
// pages.
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
$this->drupalGet($page);
$this->assertLinkByHref('admin/config');
$this->assertLinkByHref('admin/config/regional/settings');
@@ -101,7 +101,7 @@ class AdminTest extends WebTestBase {
// For a less privileged user, verify that there are no links to Locale's
// primary configuration pages, but a link to the translate page exists.
- $this->drupalLogin($this->web_user);
+ $this->drupalLogin($this->webUser);
$this->drupalGet($page);
$this->assertLinkByHref('admin/config');
$this->assertNoLinkByHref('admin/config/regional/settings');
@@ -152,7 +152,7 @@ class AdminTest extends WebTestBase {
// The front page defaults to 'user/login', which redirects to 'user/{user}'
// for authenticated users. We cannot use '<front>', since this does not
// match the redirected url.
- $frontpage_url = 'user/' . $this->admin_user->id();
+ $frontpage_url = 'user/' . $this->adminUser->id();
$this->drupalGet('admin/compact/on');
$this->assertResponse(200, 'A valid page is returned after turning on compact mode.');
diff --git a/core/modules/system/src/Tests/System/DateTimeTest.php b/core/modules/system/src/Tests/System/DateTimeTest.php
index 9176b1b..9f0b0ac 100644
--- a/core/modules/system/src/Tests/System/DateTimeTest.php
+++ b/core/modules/system/src/Tests/System/DateTimeTest.php
@@ -28,8 +28,7 @@ class DateTimeTest extends WebTestBase {
parent::setUp();
// Create admin user and log in admin user.
- $this->admin_user = $this->drupalCreateUser(array('administer site configuration'));
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin ($this->drupalCreateUser(array('administer site configuration')));
}
/**
diff --git a/core/modules/system/src/Tests/System/DefaultMobileMetaTagsTest.php b/core/modules/system/src/Tests/System/DefaultMobileMetaTagsTest.php
index dd2ec04..4232a88 100644
--- a/core/modules/system/src/Tests/System/DefaultMobileMetaTagsTest.php
+++ b/core/modules/system/src/Tests/System/DefaultMobileMetaTagsTest.php
@@ -16,9 +16,16 @@ use Drupal\simpletest\WebTestBase;
* @group system
*/
class DefaultMobileMetaTagsTest extends WebTestBase {
+ /**
+ * Array of default meta tags to insert into the page.
+ *
+ * @var array
+ */
+ protected $defaultMetaTags;
+
protected function setUp() {
parent::setUp();
- $this->default_metatags = array(
+ $this->defaultMetaTags = array(
'viewport' => '<meta name="viewport" content="width=device-width, initial-scale=1.0" />',
);
}
@@ -28,7 +35,7 @@ class DefaultMobileMetaTagsTest extends WebTestBase {
*/
public function testDefaultMetaTagsExist() {
$this->drupalGet('');
- foreach ($this->default_metatags as $name => $metatag) {
+ foreach ($this->defaultMetaTags as $name => $metatag) {
$this->assertRaw($metatag, SafeMarkup::format('Default Mobile meta tag "@name" displayed properly.', array('@name' => $name)), 'System');
}
}
@@ -39,7 +46,7 @@ class DefaultMobileMetaTagsTest extends WebTestBase {
public function testRemovingDefaultMetaTags() {
\Drupal::service('module_installer')->install(array('system_module_test'));
$this->drupalGet('');
- foreach ($this->default_metatags as $name => $metatag) {
+ foreach ($this->defaultMetaTags as $name => $metatag) {
$this->assertNoRaw($metatag, SafeMarkup::format('Default Mobile meta tag "@name" removed properly.', array('@name' => $name)), 'System');
}
}
diff --git a/core/modules/system/src/Tests/System/FrontPageTest.php b/core/modules/system/src/Tests/System/FrontPageTest.php
index 0b9d759..bb0b10b 100644
--- a/core/modules/system/src/Tests/System/FrontPageTest.php
+++ b/core/modules/system/src/Tests/System/FrontPageTest.php
@@ -23,14 +23,23 @@ class FrontPageTest extends WebTestBase {
*/
public static $modules = array('node', 'system_test', 'views');
+ /**
+ * The path to a node that is created for testing.
+ *
+ * @var string
+ */
+ protected $nodePath;
+
protected function setUp() {
parent::setUp();
// Create admin user, log in admin user, and create one node.
- $this->admin_user = $this->drupalCreateUser(array('access content', 'administer site configuration'));
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin ($this->drupalCreateUser(array(
+ 'access content',
+ 'administer site configuration',
+ )));
$this->drupalCreateContentType(array('type' => 'page'));
- $this->node_path = "node/" . $this->drupalCreateNode(array('promote' => 1))->id();
+ $this->nodePath = "node/" . $this->drupalCreateNode(array('promote' => 1))->id();
// Configure 'node' as front page.
$this->config('system.site')->set('page.front', 'node')->save();
@@ -54,7 +63,7 @@ class FrontPageTest extends WebTestBase {
$this->assertText(t('On front page.'), 'Path is the front page.');
$this->drupalGet('node');
$this->assertText(t('On front page.'), 'Path is the front page.');
- $this->drupalGet($this->node_path);
+ $this->drupalGet($this->nodePath);
$this->assertNoText(t('On front page.'), 'Path is not the front page.');
// Change the front page to an invalid path.
@@ -63,7 +72,7 @@ class FrontPageTest extends WebTestBase {
$this->assertText(t("The path '@path' is either invalid or you do not have access to it.", array('@path' => $edit['site_frontpage'])));
// Change the front page to a valid path.
- $edit['site_frontpage'] = $this->node_path;
+ $edit['site_frontpage'] = $this->nodePath;
$this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'), 'The front page path has been saved.');
@@ -71,7 +80,7 @@ class FrontPageTest extends WebTestBase {
$this->assertText(t('On front page.'), 'Path is the front page.');
$this->drupalGet('node');
$this->assertNoText(t('On front page.'), 'Path is not the front page.');
- $this->drupalGet($this->node_path);
+ $this->drupalGet($this->nodePath);
$this->assertText(t('On front page.'), 'Path is the front page.');
}
}
diff --git a/core/modules/system/src/Tests/System/MainContentFallbackTest.php b/core/modules/system/src/Tests/System/MainContentFallbackTest.php
index ae10847..a6ec81e 100644
--- a/core/modules/system/src/Tests/System/MainContentFallbackTest.php
+++ b/core/modules/system/src/Tests/System/MainContentFallbackTest.php
@@ -23,22 +23,22 @@ class MainContentFallbackTest extends WebTestBase {
*/
public static $modules = array('block', 'system_test');
- protected $admin_user;
- protected $web_user;
+ protected $adminUser;
+ protected $webUser;
protected function setUp() {
parent::setUp();
// Create and login admin user.
- $this->admin_user = $this->drupalCreateUser(array(
+ $this->adminUser = $this->drupalCreateUser(array(
'access administration pages',
'administer site configuration',
'administer modules',
));
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
// Create a web user.
- $this->web_user = $this->drupalCreateUser(array('access user profiles'));
+ $this->webUser = $this->drupalCreateUser(array('access user profiles'));
}
/**
@@ -62,12 +62,12 @@ class MainContentFallbackTest extends WebTestBase {
$this->drupalGet('system-test/main-content-fallback');
$this->assertText(t('Content to test main content fallback'), 'Fallback to SimplePageVariant works for front-end theme.');
// Request a user* page and see if it is displayed.
- $this->drupalLogin($this->web_user);
- $this->drupalGet('user/' . $this->web_user->id() . '/edit');
+ $this->drupalLogin($this->webUser);
+ $this->drupalGet('user/' . $this->webUser->id() . '/edit');
$this->assertField('mail', 'User interface still available.');
// Enable the block module again.
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
$edit = array();
$edit['modules[Core][block][enable]'] = 'block';
$this->drupalPostForm('admin/modules', $edit, t('Save configuration'));
diff --git a/core/modules/system/src/Tests/System/PageNotFoundTest.php b/core/modules/system/src/Tests/System/PageNotFoundTest.php
index 8a0a99d..41b8ed6 100644
--- a/core/modules/system/src/Tests/System/PageNotFoundTest.php
+++ b/core/modules/system/src/Tests/System/PageNotFoundTest.php
@@ -16,30 +16,30 @@ use Drupal\user\RoleInterface;
* @group system
*/
class PageNotFoundTest extends WebTestBase {
- protected $admin_user;
+ protected $adminUser;
protected function setUp() {
parent::setUp();
// Create an administrative user.
- $this->admin_user = $this->drupalCreateUser(array('administer site configuration', 'link to any page'));
+ $this->adminUser = $this->drupalCreateUser(array('administer site configuration', 'link to any page'));
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, array('access user profiles'));
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, array('access user profiles'));
}
function testPageNotFound() {
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
$this->drupalGet($this->randomMachineName(10));
$this->assertText(t('Page not found'), 'Found the default 404 page');
// Use a custom 404 page.
$edit = array(
- 'site_404' => 'user/' . $this->admin_user->id(),
+ 'site_404' => 'user/' . $this->adminUser->id(),
);
$this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration'));
$this->drupalGet($this->randomMachineName(10));
- $this->assertText($this->admin_user->getUsername(), 'Found the custom 404 page');
+ $this->assertText($this->adminUser->getUsername(), 'Found the custom 404 page');
}
}
diff --git a/core/modules/system/src/Tests/System/PageTitleTest.php b/core/modules/system/src/Tests/System/PageTitleTest.php
index 2c6f62a..1fef0a4 100644
--- a/core/modules/system/src/Tests/System/PageTitleTest.php
+++ b/core/modules/system/src/Tests/System/PageTitleTest.php
@@ -25,8 +25,8 @@ class PageTitleTest extends WebTestBase {
*/
public static $modules = array('node', 'test_page_test', 'form_test');
- protected $content_user;
- protected $saved_title;
+ protected $contentUser;
+ protected $savedTitle;
/**
* Implement setUp().
@@ -36,8 +36,8 @@ class PageTitleTest extends WebTestBase {
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
- $this->content_user = $this->drupalCreateUser(array('create page content', 'access content', 'administer themes', 'administer site configuration', 'link to any page'));
- $this->drupalLogin($this->content_user);
+ $this->contentUser = $this->drupalCreateUser(array('create page content', 'access content', 'administer themes', 'administer site configuration', 'link to any page'));
+ $this->drupalLogin($this->contentUser);
}
/**
diff --git a/core/modules/system/src/Tests/System/SiteMaintenanceTest.php b/core/modules/system/src/Tests/System/SiteMaintenanceTest.php
index 4b42674..4ce0a82 100644
--- a/core/modules/system/src/Tests/System/SiteMaintenanceTest.php
+++ b/core/modules/system/src/Tests/System/SiteMaintenanceTest.php
@@ -23,7 +23,7 @@ class SiteMaintenanceTest extends WebTestBase {
*/
public static $modules = array('node');
- protected $admin_user;
+ protected $adminUser;
protected function setUp() {
parent::setUp();
@@ -34,8 +34,8 @@ class SiteMaintenanceTest extends WebTestBase {
// Create a user allowed to access site in maintenance mode.
$this->user = $this->drupalCreateUser(array('access site in maintenance mode'));
// Create an administrative user.
- $this->admin_user = $this->drupalCreateUser(array('administer site configuration', 'access site in maintenance mode'));
- $this->drupalLogin($this->admin_user);
+ $this->adminUser = $this->drupalCreateUser(array('administer site configuration', 'access site in maintenance mode'));
+ $this->drupalLogin($this->adminUser);
}
/**
@@ -102,7 +102,7 @@ class SiteMaintenanceTest extends WebTestBase {
// Log in administrative user and configure a custom site offline message.
$this->drupalLogout();
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
$this->drupalGet('admin/config/development/maintenance');
$this->assertNoRaw($admin_message, 'Site maintenance mode message not displayed.');
diff --git a/core/modules/system/src/Tests/System/SystemAuthorizeTest.php b/core/modules/system/src/Tests/System/SystemAuthorizeTest.php
index cbc359a..3632efa 100644
--- a/core/modules/system/src/Tests/System/SystemAuthorizeTest.php
+++ b/core/modules/system/src/Tests/System/SystemAuthorizeTest.php
@@ -27,8 +27,7 @@ class SystemAuthorizeTest extends WebTestBase {
parent::setUp();
// Create an administrator user.
- $this->admin_user = $this->drupalCreateUser(array('administer software updates'));
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin ($this->drupalCreateUser(array('administer software updates')));
}
/**
diff --git a/core/modules/system/src/Tests/System/ThemeTest.php b/core/modules/system/src/Tests/System/ThemeTest.php
index ccfc727..d5bb6f6 100644
--- a/core/modules/system/src/Tests/System/ThemeTest.php
+++ b/core/modules/system/src/Tests/System/ThemeTest.php
@@ -19,6 +19,13 @@ use Drupal\simpletest\WebTestBase;
class ThemeTest extends WebTestBase {
/**
+ * A user with administrative permissions.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ protected $adminUser;
+
+ /**
* Modules to enable.
*
* @var array
@@ -30,8 +37,8 @@ class ThemeTest extends WebTestBase {
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
- $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer themes', 'bypass node access', 'administer blocks'));
- $this->drupalLogin($this->admin_user);
+ $this->adminUser = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer themes', 'bypass node access', 'administer blocks'));
+ $this->drupalLogin($this->adminUser);
$this->node = $this->drupalCreateNode();
}
@@ -215,7 +222,7 @@ class ThemeTest extends WebTestBase {
$this->drupalGet('admin/config');
$this->assertResponse(403);
$this->assertRaw('core/themes/seven', 'Administration theme used on an administration page.');
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
$this->drupalGet('node/add');
$this->assertRaw('core/themes/classy', 'Site default theme used on the add content page.');
diff --git a/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php b/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php
index 10b52e5..5c90c82 100644
--- a/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php
+++ b/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php
@@ -76,7 +76,7 @@ class EntityFilteringThemeTest extends WebTestBase {
*
* @string
*/
- protected $xss_label = "string with <em>HTML</em> and <script>alert('JS');</script>";
+ protected $xssLabel = "string with <em>HTML</em> and <script>alert('JS');</script>";
protected function setUp() {
parent::setUp();
@@ -88,13 +88,13 @@ class EntityFilteringThemeTest extends WebTestBase {
// Create a test user.
$this->user = $this->drupalCreateUser(array('access content', 'access user profiles'));
- $this->user->name = $this->xss_label;
+ $this->user->name = $this->xssLabel;
$this->user->save();
$this->drupalLogin($this->user);
// Create a test term.
$this->term = entity_create('taxonomy_term', array(
- 'name' => $this->xss_label,
+ 'name' => $this->xssLabel,
'vid' => 1,
));
$this->term->save();
@@ -103,7 +103,7 @@ class EntityFilteringThemeTest extends WebTestBase {
$this->addDefaultCommentField('node', 'article', 'comment', CommentItemInterface::OPEN);
// Create a test node tagged with the test term.
$this->node = $this->drupalCreateNode(array(
- 'title' => $this->xss_label,
+ 'title' => $this->xssLabel,
'type' => 'article',
'promote' => NODE_PROMOTED,
'field_tags' => array(array('target_id' => $this->term->id())),
@@ -115,7 +115,7 @@ class EntityFilteringThemeTest extends WebTestBase {
'entity_type' => 'node',
'field_name' => 'comment',
'status' => CommentInterface::PUBLISHED,
- 'subject' => $this->xss_label,
+ 'subject' => $this->xssLabel,
'comment_body' => array($this->randomMachineName()),
));
$this->comment->save();
@@ -141,7 +141,7 @@ class EntityFilteringThemeTest extends WebTestBase {
foreach ($paths as $path) {
$this->drupalGet($path);
$this->assertResponse(200);
- $this->assertNoRaw($this->xss_label);
+ $this->assertNoRaw($this->xssLabel);
}
}
}
diff --git a/core/modules/system/src/Tests/Theme/TwigTransTest.php b/core/modules/system/src/Tests/Theme/TwigTransTest.php
index 85ba19a..08057dc 100644
--- a/core/modules/system/src/Tests/Theme/TwigTransTest.php
+++ b/core/modules/system/src/Tests/Theme/TwigTransTest.php
@@ -35,7 +35,7 @@ class TwigTransTest extends WebTestBase {
*
* @var \Drupal\user\Entity\User
*/
- protected $admin_user;
+ protected $adminUser;
/**
* Custom languages.
@@ -58,13 +58,13 @@ class TwigTransTest extends WebTestBase {
$this->config('system.theme')->set('default', 'test_theme')->save();
// Create and log in as admin.
- $this->admin_user = $this->drupalCreateUser(array(
+ $this->adminUser = $this->drupalCreateUser(array(
'administer languages',
'access administration pages',
'administer site configuration',
'translate interface'
));
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
// Install languages.
$this->installLanguages();
diff --git a/core/modules/system/src/Tests/Update/InvalidUpdateHookTest.php b/core/modules/system/src/Tests/Update/InvalidUpdateHookTest.php
index 228d62c..84c75d8 100644
--- a/core/modules/system/src/Tests/Update/InvalidUpdateHookTest.php
+++ b/core/modules/system/src/Tests/Update/InvalidUpdateHookTest.php
@@ -30,27 +30,27 @@ class InvalidUpdateHookTest extends WebTestBase {
*
* @var string
*/
- private $update_url;
+ private $updateUrl;
/**
* A user account with upgrade permission.
*
* @var \Drupal\user\UserInterface
*/
- private $update_user;
+ private $updateUser;
protected function setUp() {
parent::setUp();
require_once \Drupal::root() . '/core/includes/update.inc';
- $this->update_url = $GLOBALS['base_url'] . '/update.php';
- $this->update_user = $this->drupalCreateUser(array('administer software updates'));
+ $this->updateUrl = $GLOBALS['base_url'] . '/update.php';
+ $this->updateUser = $this->drupalCreateUser(array('administer software updates'));
}
function testInvalidUpdateHook() {
// Confirm that a module with hook_update_8000() cannot be updated.
- $this->drupalLogin($this->update_user);
- $this->drupalGet($this->update_url);
+ $this->drupalLogin($this->updateUser);
+ $this->drupalGet($this->updateUrl);
$this->clickLink(t('Continue'));
$this->assertText(t('Some of the pending updates cannot be applied because their dependencies were not met.'));
}
diff --git a/core/modules/system/src/Tests/Update/UpdateScriptTest.php b/core/modules/system/src/Tests/Update/UpdateScriptTest.php
index 2da975f..83db3fb 100644
--- a/core/modules/system/src/Tests/Update/UpdateScriptTest.php
+++ b/core/modules/system/src/Tests/Update/UpdateScriptTest.php
@@ -23,16 +23,29 @@ class UpdateScriptTest extends WebTestBase {
*/
public static $modules = array('update_script_test', 'dblog');
+ /**
+ * {@inheritdoc}
+ */
protected $dumpHeaders = TRUE;
- private $update_url;
- private $update_user;
+ /**
+ * URL to the update.php script.
+ *
+ * @var string
+ */
+ private $updateUrl;
+
+ /**
+ * A user with the necessary permissions to administer software updates.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ private $updateUser;
protected function setUp() {
parent::setUp();
- $this->update_url = $GLOBALS['base_url'] . '/update.php';
- $this->update_user = $this->drupalCreateUser(array('administer software updates', 'access site in maintenance mode'));
- // Make sure updates for new entity type definitions are processed.
+ $this->updateUrl = $GLOBALS['base_url'] . '/update.php';
+ $this->updateUser = $this->drupalCreateUser(array('administer software updates', 'access site in maintenance mode'));
\Drupal::service('entity.definition_update_manager')->applyUpdates();
}
@@ -43,22 +56,22 @@ class UpdateScriptTest extends WebTestBase {
// Try accessing update.php without the proper permission.
$regular_user = $this->drupalCreateUser();
$this->drupalLogin($regular_user);
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalGet($this->updateUrl, array('external' => TRUE));
$this->assertResponse(403);
// Try accessing update.php as an anonymous user.
$this->drupalLogout();
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalGet($this->updateUrl, array('external' => TRUE));
$this->assertResponse(403);
// Access the update page with the proper permission.
- $this->drupalLogin($this->update_user);
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalLogin($this->updateUser);
+ $this->drupalGet($this->updateUrl, array('external' => TRUE));
$this->assertResponse(200);
// Access the update page as user 1.
$this->drupalLogin($this->rootUser);
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalGet($this->updateUrl, array('external' => TRUE));
$this->assertResponse(200);
}
@@ -67,11 +80,11 @@ class UpdateScriptTest extends WebTestBase {
*/
function testRequirements() {
$update_script_test_config = $this->config('update_script_test.settings');
- $this->drupalLogin($this->update_user);
+ $this->drupalLogin($this->updateUser);
// If there are no requirements warnings or errors, we expect to be able to
// go through the update process uninterrupted.
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalGet($this->updateUrl, array('external' => TRUE));
$this->clickLink(t('Continue'));
$this->assertText(t('No pending updates.'), 'End of update process was reached.');
// Confirm that all caches were cleared.
@@ -85,7 +98,7 @@ class UpdateScriptTest extends WebTestBase {
// successfully.
$update_script_test_config->set('requirement_type', REQUIREMENT_WARNING)->save();
drupal_set_installed_schema_version('update_script_test', drupal_get_installed_schema_version('update_script_test') - 1);
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalGet($this->updateUrl, array('external' => TRUE));
$this->assertText('This is a requirements warning provided by the update_script_test module.');
$this->clickLink('try again');
$this->assertNoText('This is a requirements warning provided by the update_script_test module.');
@@ -96,7 +109,7 @@ class UpdateScriptTest extends WebTestBase {
$this->assertText(t('hook_cache_flush() invoked for update_script_test.module.'), 'Caches were cleared after resolving a requirements warning and applying updates.');
// Now try again without pending updates to make sure that works too.
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalGet($this->updateUrl, array('external' => TRUE));
$this->assertText('This is a requirements warning provided by the update_script_test module.');
$this->clickLink('try again');
$this->assertNoText('This is a requirements warning provided by the update_script_test module.');
@@ -109,7 +122,7 @@ class UpdateScriptTest extends WebTestBase {
// clicking the link to proceed (since the problem that triggered the error
// has not been fixed).
$update_script_test_config->set('requirement_type', REQUIREMENT_ERROR)->save();
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalGet($this->updateUrl, array('external' => TRUE));
$this->assertText('This is a requirements error provided by the update_script_test module.');
$this->clickLink('try again');
$this->assertText('This is a requirements error provided by the update_script_test module.');
@@ -123,8 +136,8 @@ class UpdateScriptTest extends WebTestBase {
// unusual maintenance mode environment, we check that this rebuild did not
// put any incorrect information about the themes into the database.
$original_theme_data = $this->config('core.extension')->get('theme');
- $this->drupalLogin($this->update_user);
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalLogin($this->updateUser);
+ $this->drupalGet($this->updateUrl, ['external' => TRUE]);
$final_theme_data = $this->config('core.extension')->get('theme');
$this->assertEqual($original_theme_data, $final_theme_data, 'Visiting update.php does not alter the information about themes stored in the database.');
}
@@ -134,8 +147,8 @@ class UpdateScriptTest extends WebTestBase {
*/
function testNoUpdateFunctionality() {
// Click through update.php with 'administer software updates' permission.
- $this->drupalLogin($this->update_user);
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalLogin($this->updateUser);
+ $this->drupalGet($this->updateUrl, array('external' => TRUE));
$this->clickLink(t('Continue'));
$this->assertText(t('No pending updates.'));
$this->assertNoLink('Administration pages');
@@ -146,7 +159,7 @@ class UpdateScriptTest extends WebTestBase {
// Click through update.php with 'access administration pages' permission.
$admin_user = $this->drupalCreateUser(array('administer software updates', 'access administration pages'));
$this->drupalLogin($admin_user);
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalGet($this->updateUrl, array('external' => TRUE));
$this->clickLink(t('Continue'));
$this->assertText(t('No pending updates.'));
$this->assertLink('Administration pages');
@@ -168,8 +181,8 @@ class UpdateScriptTest extends WebTestBase {
$this->assertEqual($schema_version, 8000, 'update_script_test schema version overridden to 8000.');
// Click through update.php with 'administer software updates' permission.
- $this->drupalLogin($this->update_user);
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalLogin($this->updateUser);
+ $this->drupalGet($this->updateUrl, array('external' => TRUE));
$this->clickLink(t('Continue'));
$this->clickLink(t('Apply pending updates'));
@@ -204,7 +217,7 @@ class UpdateScriptTest extends WebTestBase {
// 'access site reports' permissions.
$admin_user = $this->drupalCreateUser(array('administer software updates', 'access administration pages', 'access site reports', 'access site in maintenance mode'));
$this->drupalLogin($admin_user);
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalGet($this->updateUrl, array('external' => TRUE));
$this->clickLink(t('Continue'));
$this->clickLink(t('Apply pending updates'));
$this->assertText('Updates were attempted.');
diff --git a/core/modules/system/src/Tests/Update/UpdatesWith7xTest.php b/core/modules/system/src/Tests/Update/UpdatesWith7xTest.php
index 09daad3..288533e 100644
--- a/core/modules/system/src/Tests/Update/UpdatesWith7xTest.php
+++ b/core/modules/system/src/Tests/Update/UpdatesWith7xTest.php
@@ -27,18 +27,18 @@ class UpdatesWith7xTest extends WebTestBase {
/**
* The URL for the update page.
*/
- private $update_url;
+ private $updateUrl;
/**
* An administrative user.
*/
- private $update_user;
+ private $updateUser;
protected function setUp() {
parent::setUp();
require_once \Drupal::root() . '/core/includes/update.inc';
- $this->update_url = $GLOBALS['base_url'] . '/update.php';
- $this->update_user = $this->drupalCreateUser(array('administer software updates'));
+ $this->updateUrl = $GLOBALS['base_url'] . '/update.php';
+ $this->updateUser = $this->drupalCreateUser(array('administer software updates'));
}
function testWith7x() {
@@ -51,8 +51,8 @@ class UpdatesWith7xTest extends WebTestBase {
drupal_set_installed_schema_version('update_test_with_7x', 7110);
// Click through update.php with 'administer software updates' permission.
- $this->drupalLogin($this->update_user);
- $this->drupalGet($this->update_url, array('external' => TRUE));
+ $this->drupalLogin($this->updateUser);
+ $this->drupalGet($this->updateUrl, array('external' => TRUE));
$this->clickLink(t('Continue'));
$this->assertText(t('Some of the pending updates cannot be applied because their dependencies were not met.'));
}