diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentCommentsTest.php similarity index 98% rename from core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php rename to core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentCommentsTest.php index 5b0e8e6..3f1d20c 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentCommentsTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\comment\Tests\Views\DefaultViewRecentComments. + * Contains \Drupal\comment\Tests\Views\DefaultViewRecentCommentsTest. */ namespace Drupal\comment\Tests\Views; @@ -12,7 +12,7 @@ use Drupal\views\Views; use Drupal\views\Tests\ViewTestBase; -class DefaultViewRecentComments extends ViewTestBase { +class DefaultViewRecentCommentsTest extends ViewTestBase { /** * Modules to enable. diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageBrowserDetectionUnitTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageBrowserDetectionTest.php similarity index 98% rename from core/modules/language/lib/Drupal/language/Tests/LanguageBrowserDetectionUnitTest.php rename to core/modules/language/lib/Drupal/language/Tests/LanguageBrowserDetectionTest.php index 5571668..e0e2ab9 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageBrowserDetectionUnitTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageBrowserDetectionTest.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\language\Tests\LanguageBrowserDetectionUnitTest. + * Contains \Drupal\language\Tests\LanguageBrowserDetectionTest. */ namespace Drupal\language\Tests; @@ -15,7 +15,7 @@ /** * Test browser language detection. */ -class LanguageBrowserDetectionUnitTest extends WebTestBase { +class LanguageBrowserDetectionTest extends WebTestBase { public static $modules = array('language'); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleJavascriptTranslation.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleJavascriptTranslationTest.php similarity index 96% rename from core/modules/locale/lib/Drupal/locale/Tests/LocaleJavascriptTranslation.php rename to core/modules/locale/lib/Drupal/locale/Tests/LocaleJavascriptTranslationTest.php index 8356693..5a20769 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleJavascriptTranslation.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleJavascriptTranslationTest.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\locale\Tests\LocaleJavascriptTranslation. + * Contains \Drupal\locale\Tests\LocaleJavascriptTranslationTest. */ namespace Drupal\locale\Tests; @@ -13,7 +13,7 @@ /** * Functional tests for JavaScript parsing for translatable strings. */ -class LocaleJavascriptTranslation extends WebTestBase { +class LocaleJavascriptTranslationTest extends WebTestBase { /** * Modules to enable. diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchExpressionInsertExtractUnitTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchExpressionInsertExtractUnitTest.php new file mode 100644 index 0000000..5d28f88 --- /dev/null +++ b/core/modules/search/lib/Drupal/search/Tests/SearchExpressionInsertExtractUnitTest.php @@ -0,0 +1,70 @@ + 'Search expression insert/extract', + 'description' => 'Tests the functions search_expression_insert() and search_expression_extract()', + 'group' => 'Search', + ); + } + + function setUp() { + parent::setUp(); + } + + /** + * Tests search_expression_insert() and search_expression_extract(). + */ + function testInsertExtract() { + $base_expression = "mykeyword"; + // Build an array of option, value, what should be in the expression, what + // should be retrieved from expression. + $cases = array( + array('foo', 'bar', 'foo:bar', 'bar'), // Normal case. + array('foo', NULL, '', NULL), // Empty value: shouldn't insert. + array('foo', ' ', 'foo:', ''), // Space as value: should insert but retrieve empty string. + array('foo', '', 'foo:', ''), // Empty string as value: should insert but retrieve empty string. + array('foo', '0', 'foo:0', '0'), // String zero as value: should insert. + array('foo', 0, 'foo:0', '0'), // Numeric zero as value: should insert. + ); + + foreach ($cases as $index => $case) { + $after_insert = search_expression_insert($base_expression, $case[0], $case[1]); + if (empty($case[2])) { + $this->assertEqual($after_insert, $base_expression, "Empty insert does not change expression in case $index"); + } + else { + $this->assertEqual($after_insert, $base_expression . ' ' . $case[2], "Insert added correct expression for case $index"); + } + + $retrieved = search_expression_extract($after_insert, $case[0]); + if (!isset($case[3])) { + $this->assertFalse(isset($retrieved), "Empty retrieval results in unset value in case $index"); + } + else { + $this->assertEqual($retrieved, $case[3], "Value is retrieved for case $index"); + } + + $after_clear = search_expression_insert($after_insert, $case[0]); + $this->assertEqual(trim($after_clear), $base_expression, "After clearing, base expression is restored for case $index"); + + $cleared = search_expression_extract($after_clear, $case[0]); + $this->assertFalse(isset($cleared), "After clearing, value could not be retrieved for case $index"); + } + } +} diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/ColorUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/ColorUnitTest.php new file mode 100644 index 0000000..5f96f0e --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Tests/Common/ColorUnitTest.php @@ -0,0 +1,100 @@ + 'Color conversion', + 'description' => 'Tests Color utility class conversions.', + 'group' => 'Common', + ); + } + + /** + * Tests Color::hexToRgb(). + */ + function testHexToRgb() { + // Any invalid arguments should throw an exception. + $values = array('', '-1', '1', '12', '12345', '1234567', '123456789', '123456789a', 'foo'); + // Duplicate all invalid value tests with additional '#' prefix. + // The '#' prefix inherently turns the data type into a string. + foreach ($values as $value) { + $values[] = '#' . $value; + } + // Add invalid data types (hex value must be a string). + $values = array_merge($values, array( + 1, 12, 1234, 12345, 123456, 1234567, 12345678, 123456789, 123456789, + -1, PHP_INT_MAX, PHP_INT_MAX + 1, -PHP_INT_MAX, + 0x0, 0x010, + )); + + foreach ($values as $test) { + $this->assertFalse(Color::validateHex($test), var_export($test, TRUE) . ' is invalid.'); + try { + Color::hexToRgb($test); + $this->fail('Color::hexToRgb(' . var_export($test, TRUE) . ') did not throw an exception.'); + } + catch (\InvalidArgumentException $e) { + $this->pass('Color::hexToRgb(' . var_export($test, TRUE) . ') threw an exception.'); + } + } + + // PHP automatically casts a numeric array key into an integer. + // Since hex values may consist of 0-9 only, they need to be defined as + // array values. + $tests = array( + // Shorthands without alpha. + array('hex' => '#000', 'rgb' => array('red' => 0, 'green' => 0, 'blue' => 0)), + array('hex' => '#fff', 'rgb' => array('red' => 255, 'green' => 255, 'blue' => 255)), + array('hex' => '#abc', 'rgb' => array('red' => 170, 'green' => 187, 'blue' => 204)), + array('hex' => 'cba', 'rgb' => array('red' => 204, 'green' => 187, 'blue' => 170)), + // Full without alpha. + array('hex' => '#000000', 'rgb' => array('red' => 0, 'green' => 0, 'blue' => 0)), + array('hex' => '#ffffff', 'rgb' => array('red' => 255, 'green' => 255, 'blue' => 255)), + array('hex' => '#010203', 'rgb' => array('red' => 1, 'green' => 2, 'blue' => 3)), + ); + foreach ($tests as $test) { + $result = Color::hexToRgb($test['hex']); + $this->assertIdentical($result, $test['rgb']); + } + } + + /** + * Tests Color::rgbToHex(). + */ + function testRgbToHex() { + $tests = array( + '#000000' => array('red' => 0, 'green' => 0, 'blue' => 0), + '#ffffff' => array('red' => 255, 'green' => 255, 'blue' => 255), + '#777777' => array('red' => 119, 'green' => 119, 'blue' => 119), + '#010203' => array('red' => 1, 'green' => 2, 'blue' => 3), + ); + // Input using named RGB array (e.g., as returned by Color::hexToRgb()). + foreach ($tests as $expected => $rgb) { + $this->assertIdentical(Color::rgbToHex($rgb), $expected); + } + // Input using indexed RGB array (e.g.: array(10, 10, 10)). + foreach ($tests as $expected => $rgb) { + $rgb = array_values($rgb); + $this->assertIdentical(Color::rgbToHex($rgb), $expected); + } + // Input using CSS RGB string notation (e.g.: 10, 10, 10). + foreach ($tests as $expected => $rgb) { + $rgb = implode(', ', $rgb); + $this->assertIdentical(Color::rgbToHex($rgb), $expected); + } + } +} diff --git a/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php b/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelUnitTest.php similarity index 98% rename from core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php rename to core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelUnitTest.php index 26b1b76..a9ff5f6 100644 --- a/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelUnitTest.php @@ -15,7 +15,7 @@ /** * Tests compilation of the DIC. */ -class DrupalKernelTest extends DrupalUnitTestBase { +class DrupalKernelUnitTest extends DrupalUnitTestBase { public static function getInfo() { return array( diff --git a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageExpirableTest.php b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageExpirableUnitTest.php similarity index 97% rename from core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageExpirableTest.php rename to core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageExpirableUnitTest.php index 19a261b..77d9476 100644 --- a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageExpirableTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageExpirableUnitTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\system\Tests\KeyValueStore\DatabaseStorageExpirableTest. + * Contains \Drupal\system\Tests\KeyValueStore\DatabaseStorageExpirableUnitTest. */ namespace Drupal\system\Tests\KeyValueStore; @@ -12,7 +12,7 @@ /** * Tests the key-value database storage. */ -class DatabaseStorageExpirableTest extends StorageTestBase { +class DatabaseStorageExpirableUnitTest extends StorageUnitTestBase { public static function getInfo() { return array( diff --git a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageTest.php b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageUnitTest.php similarity index 89% rename from core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageTest.php rename to core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageUnitTest.php index ad286d6..c2bf11c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageUnitTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\system\Tests\KeyValueStore\DatabaseStorageTest. + * Contains \Drupal\system\Tests\KeyValueStore\DatabaseStorageUnitTest. */ namespace Drupal\system\Tests\KeyValueStore; @@ -12,7 +12,7 @@ /** * Tests the key-value database storage. */ -class DatabaseStorageTest extends StorageTestBase { +class DatabaseStorageUnitTest extends StorageUnitTestBase { public static function getInfo() { return array( diff --git a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/GarbageCollectionTest.php b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/GarbageCollectionUnitTest.php similarity index 94% rename from core/modules/system/lib/Drupal/system/Tests/KeyValueStore/GarbageCollectionTest.php rename to core/modules/system/lib/Drupal/system/Tests/KeyValueStore/GarbageCollectionUnitTest.php index 2835a47..6398f1d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/GarbageCollectionTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/GarbageCollectionUnitTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\system\Tests\KeyValueStore\GarbageCollectionTest. + * Contains \Drupal\system\Tests\KeyValueStore\GarbageCollectionUnitTest. */ namespace Drupal\system\Tests\KeyValueStore; @@ -14,7 +14,7 @@ /** * Tests garbage collection for DatabaseStorageExpirable. */ -class GarbageCollectionTest extends UnitTestBase { +class GarbageCollectionUnitTest extends UnitTestBase { public static function getInfo() { return array( diff --git a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/MemoryStorageTest.php b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/MemoryStorageUnitTest.php similarity index 84% rename from core/modules/system/lib/Drupal/system/Tests/KeyValueStore/MemoryStorageTest.php rename to core/modules/system/lib/Drupal/system/Tests/KeyValueStore/MemoryStorageUnitTest.php index ca065fa..3274369 100644 --- a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/MemoryStorageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/MemoryStorageUnitTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\system\Tests\KeyValueStore\MemoryStorageTest. + * Contains \Drupal\system\Tests\KeyValueStore\MemoryStorageUnitTest. */ namespace Drupal\system\Tests\KeyValueStore; @@ -10,7 +10,7 @@ /** * Tests the key-value memory storage. */ -class MemoryStorageTest extends StorageTestBase { +class MemoryStorageUnitTest extends StorageUnitTestBase { /** * Holds the original default key/value service name. diff --git a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/StorageTestBase.php b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/StorageUnitTestBase.php similarity index 98% rename from core/modules/system/lib/Drupal/system/Tests/KeyValueStore/StorageTestBase.php rename to core/modules/system/lib/Drupal/system/Tests/KeyValueStore/StorageUnitTestBase.php index 86e6ce8..77a67dc 100644 --- a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/StorageTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/StorageUnitTestBase.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\system\Tests\KeyValueStore\StorageTestBase. + * Contains \Drupal\system\Tests\KeyValueStore\StorageUnitTestBase. */ namespace Drupal\system\Tests\KeyValueStore; @@ -14,7 +14,7 @@ /** * Base class for testing key-value storages. */ -abstract class StorageTestBase extends UnitTestBase { +abstract class StorageUnitTestBase extends UnitTestBase { /** * An array of random stdClass objects. diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnableTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnableTest.php index e69de29..fff1e30 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnableTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnableTest.php @@ -0,0 +1,73 @@ + 'Module enable', + 'description' => 'Tests enabling modules.', + 'group' => 'Module', + ); + } + + /** + * Tests enabling User module once more. + * + * Regression: The installer might enable a module twice due to automatic + * dependency resolution. A bug caused the stored weight for User module to + * be an array. + */ + function testEnableUserTwice() { + $this->container->get('module_handler')->install(array('user'), FALSE); + $this->assertIdentical(\Drupal::config('system.module')->get('enabled.user'), 0); + } + + /** + * Tests recorded schema versions of early installed modules in the installer. + */ + function testRequiredModuleSchemaVersions() { + $version = drupal_get_installed_schema_version('system', TRUE); + $this->assertTrue($version > 0, 'System module version is > 0.'); + $version = drupal_get_installed_schema_version('user', TRUE); + $this->assertTrue($version > 0, 'User module version is > 0.'); + } + + /** + * Tests that an exception is thrown when a module name is too long. + */ + function testModuleNameLength() { + $module_name = 'invalid_module_name_over_the_maximum_allowed_character_length'; + $message = format_string('Exception thrown when enabling module %name with a name length over the allowed maximum', array('%name' => $module_name)); + try { + $this->container->get('module_handler')->install(array($module_name)); + $this->fail($message); + } + catch (ExtensionNameLengthException $e) { + $this->pass($message); + } + + // Since for the UI, the submit callback uses FALSE, test that too. + $message = format_string('Exception thrown when enabling as if via the UI the module %name with a name length over the allowed maximum', array('%name' => $module_name)); + try { + $this->container->get('module_handler')->install(array($module_name), FALSE); + $this->fail($message); + } + catch (ExtensionNameLengthException $e) { + $this->pass($message); + } + } + +} diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/ControllerResolverUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Routing/ControllerResolverUnitTest.php new file mode 100644 index 0000000..12cdd36 --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Tests/Routing/ControllerResolverUnitTest.php @@ -0,0 +1,43 @@ + 'Controller Resolver tests', + 'description' => 'Tests that the Drupal-extended ControllerResolver is functioning properly.', + 'group' => 'Routing', + ); + } + + /** + * Confirms that a container aware controller gets returned. + */ + function testContainerAware() { + $container = new Container(); + $resolver = new ControllerResolver($container); + + $request = Request::create('/some/path'); + $request->attributes->set('_controller', '\Drupal\system\Tests\Routing\MockController::run'); + + $controller = $resolver->getController($request); + + $this->assertTrue($controller[0] instanceof MockController, 'The correct controller object was returned.'); + } +} diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/MatcherDumperTest.php b/core/modules/system/lib/Drupal/system/Tests/Routing/MatcherDumperUnitTest.php similarity index 98% rename from core/modules/system/lib/Drupal/system/Tests/Routing/MatcherDumperTest.php rename to core/modules/system/lib/Drupal/system/Tests/Routing/MatcherDumperUnitTest.php index 8514b3f..3db5c17 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Routing/MatcherDumperTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Routing/MatcherDumperUnitTest.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\system\Tests\Routing\UrlMatcherDumperTest. + * Contains \Drupal\system\Tests\Routing\MatcherDumperUnitTest. */ namespace Drupal\system\Tests\Routing; @@ -18,7 +18,7 @@ /** * Basic tests for the UrlMatcherDumper. */ -class MatcherDumperTest extends UnitTestBase { +class MatcherDumperUnitTest extends UnitTestBase { /** * A collection of shared fixture data for tests. diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/RouteUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Routing/RouteUnitTest.php new file mode 100644 index 0000000..0538473 --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Tests/Routing/RouteUnitTest.php @@ -0,0 +1,60 @@ + 'Routes', + 'description' => 'Confirm that route object is functioning properly.', + 'group' => 'Routing', + ); + } + + function setUp() { + parent::setUp(); + } + + /** + * Confirms that a route compiles properly with the necessary data. + */ + public function testCompilation() { + $route = new Route('/test/{something}/more'); + $route->setOption('compiler_class', 'Drupal\Core\Routing\RouteCompiler'); + $compiled = $route->compile(); + + $this->assertEqual($route, $compiled->getRoute(), 'Compiled route has the correct route object.'); + $this->assertEqual($compiled->getFit(), 5 /* That's 101 binary*/, 'The fit was correct.'); + $this->assertEqual($compiled->getPatternOutline(), '/test/%/more', 'The pattern outline was correct.'); + } + + /** + * Confirms that a compiled route with default values has the correct outline. + */ + public function testCompilationDefaultValue() { + // Because "here" has a default value, it should not factor into the outline + // or the fitness. + $route = new Route('/test/{something}/more/{here}', array( + 'here' => 'there', + )); + $route->setOption('compiler_class', 'Drupal\Core\Routing\RouteCompiler'); + $compiled = $route->compile(); + + $this->assertEqual($route, $compiled->getRoute(), 'Compiled route has the correct route object.'); + $this->assertEqual($compiled->getFit(), 5 /* That's 101 binary*/, 'The fit was correct.'); + $this->assertEqual($compiled->getPatternOutline(), '/test/%/more', 'The pattern outline was correct.'); + } + +} diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/RelationshipRepresentativeNode.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/RelationshipRepresentativeNodeTest.php similarity index 93% rename from core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/RelationshipRepresentativeNode.php rename to core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/RelationshipRepresentativeNodeTest.php index 1d754f0..493e25b 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/RelationshipRepresentativeNode.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/RelationshipRepresentativeNodeTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\taxonomy\Tests\Views\RelationshipRepresentativeNode. + * Contains \Drupal\taxonomy\Tests\Views\RelationshipRepresentativeNodeTest. */ namespace Drupal\taxonomy\Tests\Views; @@ -12,7 +12,7 @@ /** * Tests the representative node relationship for terms. */ -class RelationshipRepresentativeNode extends TaxonomyTestBase { +class RelationshipRepresentativeNodeTest extends TaxonomyTestBase { /** * Views used by this test. diff --git a/core/modules/user/lib/Drupal/user/Tests/TempStoreDatabaseTest.php b/core/modules/user/lib/Drupal/user/Tests/TempStoreDatabaseUnitTest.php similarity index 97% rename from core/modules/user/lib/Drupal/user/Tests/TempStoreDatabaseTest.php rename to core/modules/user/lib/Drupal/user/Tests/TempStoreDatabaseUnitTest.php index 0437837..2d9b715 100644 --- a/core/modules/user/lib/Drupal/user/Tests/TempStoreDatabaseTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/TempStoreDatabaseUnitTest.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\user\Tests\TempStoreDatabaseTest. + * Contains \Drupal\user\Tests\TempStoreDatabaseUnitTest. */ namespace Drupal\user\Tests; @@ -17,7 +17,7 @@ * * @see \Drupal\Core\TempStore\TempStore. */ -class TempStoreDatabaseTest extends UnitTestBase { +class TempStoreDatabaseUnitTest extends UnitTestBase { /** * A key/value store factory. diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php b/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTest.php similarity index 97% rename from core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php rename to core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTest.php index bbe5a71..6418de4 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTest.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\user\Tests\UserAccountLinksTests. + * Contains \Drupal\user\Tests\UserAccountLinksTest. */ namespace Drupal\user\Tests; @@ -12,7 +12,7 @@ /** * Tests user links in the secondary menu. */ -class UserAccountLinksTests extends WebTestBase { +class UserAccountLinksTest extends WebTestBase { /** * Modules to enable. diff --git a/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php b/core/modules/user/lib/Drupal/user/Tests/UserBlocksTest.php similarity index 97% rename from core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php rename to core/modules/user/lib/Drupal/user/Tests/UserBlocksTest.php index 50127b4..42bf407 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserBlocksTest.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\user\Tests\UserBlocksTests. + * Contains \Drupal\user\Tests\UserBlocksTest. */ namespace Drupal\user\Tests; @@ -12,7 +12,7 @@ /** * Test user blocks. */ -class UserBlocksTests extends WebTestBase { +class UserBlocksTest extends WebTestBase { /** * Modules to enable. diff --git a/core/modules/views/lib/Drupal/views/Tests/PluginTypeListUnitTest.php b/core/modules/views/lib/Drupal/views/Tests/PluginTypeListUnitTest.php new file mode 100644 index 0000000..0e0b1af --- /dev/null +++ b/core/modules/views/lib/Drupal/views/Tests/PluginTypeListUnitTest.php @@ -0,0 +1,55 @@ + 'Plugin list', + 'description' => 'Tests that list of plugin is correct.', + 'group' => 'Views', + ); + } + + /** + * Tests the plugins list is correct. + */ + public function testPluginList() { + $plugin_list = array( + 'access', + 'area', + 'argument', + 'argument_default', + 'argument_validator', + 'cache', + 'display_extender', + 'display', + 'exposed_form', + 'field', + 'filter', + 'join', + 'pager', + 'query', + 'relationship', + 'row', + 'sort', + 'style', + 'wizard', + ); + + $diff = array_diff($plugin_list, ViewExecutable::getPluginTypes()); + $this->assertTrue(empty($diff), 'The plugin list is correct'); + } + +} diff --git a/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/Tests/NestedMatcher/NestedMatcherTest.php b/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/Tests/NestedMatcher/NestedMatcherUnitTest.php similarity index 100% rename from core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/Tests/NestedMatcher/NestedMatcherTest.php rename to core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/Tests/NestedMatcher/NestedMatcherUnitTest.php