Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes

This commit is contained in:
Pantheon Automation 2016-04-20 09:56:34 -07:00 committed by Greg Anderson
parent b11a755ba8
commit c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions

View file

@ -1,3 +1,4 @@
<?php
// @codingStandardsIgnoreFile
print 'SimpleTest PHP was executed!';
?>

View file

@ -1,2 +1,3 @@
<?php
// @codingStandardsIgnoreFile
print 'SimpleTest PHP was executed!';

View file

@ -19,7 +19,6 @@ function simpletest_requirements($phase) {
$requirements = array();
$has_curl = function_exists('curl_init');
$has_domdocument = method_exists('DOMDocument', 'loadHTML');
$open_basedir = ini_get('open_basedir');
$requirements['curl'] = array(
@ -28,16 +27,7 @@ function simpletest_requirements($phase) {
);
if (!$has_curl) {
$requirements['curl']['severity'] = REQUIREMENT_ERROR;
$requirements['curl']['description'] = t('The testing framework could not be installed because the PHP <a href=":curl_url">cURL</a> library is not available.', array(':curl_url' => 'http://php.net/manual/curl.setup.php'));
}
$requirements['php_domdocument'] = array(
'title' => t('PHP DOMDocument class'),
'value' => $has_domdocument ? t('Enabled') : t('Not found'),
);
if (!$has_domdocument) {
$requirements['php_domdocument']['severity'] = REQUIREMENT_ERROR;
$requirements['php_domdocument']['description'] = t('The testing framework requires the DOMDocument class to be available. Check the configure command at the <a href=":link-phpinfo">PHP info page</a>.', array(':link-phpinfo' => \Drupal::url('system.php')));
$requirements['curl']['description'] = t('The testing framework could not be installed because the PHP <a href="http://php.net/manual/curl.setup.php">cURL</a> library is not available.');
}
// SimpleTest currently needs 2 cURL options which are incompatible with
@ -49,7 +39,7 @@ function simpletest_requirements($phase) {
);
if ($open_basedir) {
$requirements['php_open_basedir']['severity'] = REQUIREMENT_ERROR;
$requirements['php_open_basedir']['description'] = t('The testing framework requires the PHP <a href=":open_basedir-url">open_basedir</a> restriction to be disabled. Check your webserver configuration or contact your web host.', array(':open_basedir-url' => 'http://php.net/manual/ini.core.php#ini.open-basedir'));
$requirements['php_open_basedir']['description'] = t('The testing framework requires the PHP <a href="http://php.net/manual/ini.core.php#ini.open-basedir">open_basedir</a> restriction to be disabled. Check your webserver configuration or contact your web host.');
}
// Check the current memory limit. If it is set too low, SimpleTest will fail

View file

@ -3,7 +3,7 @@
* Simpletest behaviors.
*/
(function ($) {
(function ($, Drupal, drupalSettings) {
'use strict';
@ -127,4 +127,4 @@
}
};
})(jQuery);
})(jQuery, Drupal, drupalSettings);

View file

@ -1,5 +1,10 @@
<?php
/**
* @file
* Provides testing functionality.
*/
use Drupal\Core\Asset\AttachedAssetsInterface;
use Drupal\Core\Database\Database;
use Drupal\Core\Render\Element;
@ -8,11 +13,6 @@ use Drupal\simpletest\TestBase;
use Drupal\simpletest\TestDiscovery;
use Symfony\Component\Process\PhpExecutableFinder;
/**
* @file
* Provides testing functionality.
*/
/**
* Implements hook_help().
*/
@ -181,6 +181,8 @@ function simpletest_run_tests($test_list) {
function simpletest_run_phpunit_tests($test_id, array $unescaped_test_classnames, &$status = NULL) {
$phpunit_file = simpletest_phpunit_xml_filepath($test_id);
simpletest_phpunit_run_command($unescaped_test_classnames, $phpunit_file, $status);
$rows = simpletest_phpunit_xml_to_rows($test_id, $phpunit_file);
// A $status of 0 = passed test, 1 = failed test, > 1 indicates segfault
// timeout, or other type of failure.
if ($status > 1) {
@ -197,9 +199,6 @@ function simpletest_run_phpunit_tests($test_id, array $unescaped_test_classnames
'file' => $phpunit_file,
];
}
else {
$rows = simpletest_phpunit_xml_to_rows($test_id, $phpunit_file);
}
return $rows;
}

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\AssertContentTrait.
*/
namespace Drupal\simpletest;
use Drupal\Component\Serialization\Json;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\AssertHelperTrait.
*/
namespace Drupal\simpletest;
use Drupal\Component\Render\MarkupInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\BlockCreationTrait.
*/
namespace Drupal\simpletest;
use Drupal\block\Entity\Block;

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,4 @@
<?php
/**
* @file
* Contains Drupal\simpletest\ContentTypeCreationTrait.
*/
namespace Drupal\simpletest;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Exception\MissingGroupException.
*/
namespace Drupal\simpletest\Exception;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Form\SimpletestResultsForm.
*/
namespace Drupal\simpletest\Form;
use Drupal\Core\Database\Connection;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Form\SimpletestSettingsForm.
*/
namespace Drupal\simpletest\Form;
use Drupal\Core\Form\ConfigFormBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Form\SimpletestTestForm.
*/
namespace Drupal\simpletest\Form;
use Drupal\Core\Form\FormBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\InstallerTestBase.
*/
namespace Drupal\simpletest;
use Drupal\Core\DrupalKernel;
@ -118,7 +113,7 @@ abstract class InstallerTestBase extends WebTestBase {
->set('app.root', DRUPAL_ROOT);
\Drupal::setContainer($this->container);
$this->drupalGet($GLOBALS['base_url'] . '/core/install.php');
$this->visitInstaller();
// Select language.
$this->setUpLanguage();
@ -164,6 +159,13 @@ abstract class InstallerTestBase extends WebTestBase {
}
}
/**
* Visits the interactive installer.
*/
protected function visitInstaller() {
$this->drupalGet($GLOBALS['base_url'] . '/core/install.php');
}
/**
* Installer step: Select language.
*/

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\KernelTestBase.
*/
namespace Drupal\simpletest;
use Drupal\Component\Utility\Html;
@ -435,10 +430,18 @@ EOD;
if (!$this->container->get('module_handler')->moduleExists($module)) {
throw new \RuntimeException("'$module' module is not enabled");
}
$tables = (array) $tables;
foreach ($tables as $table) {
$schema = drupal_get_module_schema($module, $table);
if (empty($schema)) {
// BC layer to avoid some contrib tests to fail.
// @todo Remove the BC layer before 8.1.x release.
// @see https://www.drupal.org/node/2670360
// @see https://www.drupal.org/node/2670454
if ($module == 'system') {
continue;
}
throw new \RuntimeException("Unknown '$table' table schema in '$module' module.");
}
$this->container->get('database')->schema()->createTable($table, $schema);
@ -602,9 +605,7 @@ EOD;
protected function render(array &$elements) {
// Use the bare HTML page renderer to render our links.
$renderer = $this->container->get('bare_html_page_renderer');
$response = $renderer->renderBarePage(
$elements, '', $this->container->get('theme.manager')->getActiveTheme()->getName()
);
$response = $renderer->renderBarePage($elements, '', 'maintenance_page');
// Glean the content from the response object.
$content = $response->getContent();

View file

@ -1,8 +1,4 @@
<?php
/**
* @file
* Contains Drupal\simpletest\NodeCreationTrait
*/
namespace Drupal\simpletest;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\RandomGeneratorTrait.
*/
namespace Drupal\simpletest;
use Drupal\Component\Utility\Random;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\ProxyClass\Routing\RouteProvider.
*/
namespace Drupal\simpletest;
use Drupal\Core\Routing\PreloadableRouteProviderInterface;
@ -13,6 +8,9 @@ use Symfony\Component\HttpFoundation\Request;
/**
* Rebuilds the router when the provider is instantiated.
*
* @todo Move this outside of simpletest namespace to the Drupal\Tests, see
* https://www.drupal.org/node/2672762
*/
class RouteProvider implements PreloadableRouteProviderInterface, PagedRouteProviderInterface {

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\SessionTestTrait.
*/
namespace Drupal\simpletest;
use Symfony\Component\HttpFoundation\Request;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\TestBase.
*/
namespace Drupal\simpletest;
use Drupal\Component\Render\MarkupInterface;
@ -314,7 +309,7 @@ abstract class TestBase {
* HTTP authentication method (specified as a CURLAUTH_* constant).
*
* @var int
* @see http://php.net/manual/en/function.curl-setopt.php
* @see http://php.net/manual/function.curl-setopt.php
*/
protected $httpAuthMethod = CURLAUTH_BASIC;

View file

@ -1,17 +1,11 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\TestDiscovery.
*/
namespace Drupal\simpletest;
use Doctrine\Common\Annotations\SimpleAnnotationReader;
use Doctrine\Common\Reflection\StaticReflectionParser;
use Drupal\Component\Annotation\Reflection\MockFileFinder;
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ExtensionDiscovery;
use Drupal\Core\Extension\ModuleHandlerInterface;
@ -124,6 +118,7 @@ class TestDiscovery {
$this->testNamespaces["Drupal\\Tests\\$name\\Unit\\"][] = "$base_path/tests/src/Unit";
$this->testNamespaces["Drupal\\Tests\\$name\\Kernel\\"][] = "$base_path/tests/src/Kernel";
$this->testNamespaces["Drupal\\Tests\\$name\\Functional\\"][] = "$base_path/tests/src/Functional";
$this->testNamespaces["Drupal\\Tests\\$name\\FunctionalJavascript\\"][] = "$base_path/tests/src/FunctionalJavascript";
}
foreach ($this->testNamespaces as $prefix => $paths) {

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\TestServiceProvider.
*/
namespace Drupal\simpletest;
use Drupal\Core\DependencyInjection\ContainerBuilder;
@ -33,15 +28,25 @@ class TestServiceProvider implements ServiceProviderInterface, ServiceModifierIn
*/
public function alter(ContainerBuilder $container) {
if (static::$currentTest instanceof KernelTestBase) {
// While $container->get() does a recursive resolve, getDefinition() does
// not, so do it ourselves.
foreach (['router.route_provider' => 'RouteProvider'] as $original_id => $class) {
for ($id = $original_id; $container->hasAlias($id); $id = (string) $container->getAlias($id));
$definition = $container->getDefinition($id);
$definition->clearTag('needs_destruction');
$container->setDefinition("simpletest.$original_id", $definition);
$container->setDefinition($id, new Definition('Drupal\simpletest\\' . $class));
}
static::addRouteProvider($container);
}
}
/**
* Add the on demand rebuild route provider service.
*
* @param \Drupal\Core\DependencyInjection\ContainerBuilder $container
*/
public static function addRouteProvider(ContainerBuilder $container) {
foreach (['router.route_provider' => 'RouteProvider'] as $original_id => $class) {
// While $container->get() does a recursive resolve, getDefinition() does
// not, so do it ourselves.
for ($id = $original_id; $container->hasAlias($id); $id = (string) $container->getAlias($id));
$definition = $container->getDefinition($id);
$definition->clearTag('needs_destruction');
$container->setDefinition("simpletest.$original_id", $definition);
$container->setDefinition($id, new Definition('Drupal\simpletest\\' . $class));
}
}
}

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\BrokenSetUpTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\simpletest\WebTestBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\BrowserTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\simpletest\WebTestBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\FolderTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\simpletest\WebTestBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\InstallationProfileModuleTestsTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\simpletest\WebTestBase;

View file

@ -1,14 +1,12 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\KernelTestBaseTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\Core\Database\Database;
use Drupal\field\Entity\FieldConfig;
use Drupal\simpletest\KernelTestBase;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
/**
* Tests KernelTestBase functionality.
@ -272,21 +270,21 @@ EOS;
$this->enableModules(array('field_test'));
// Create a field.
entity_create('entity_view_display', array(
$display = EntityViewDisplay::create(array(
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
'mode' => 'default',
));
$field_storage = entity_create('field_storage_config', array(
$field_storage = FieldStorageConfig::create(array(
'field_name' => 'test_field',
'entity_type' => 'entity_test',
'type' => 'test_field'
));
$field_storage->save();
entity_create('field_config', array(
FieldConfig::create([
'field_storage' => $field_storage,
'bundle' => 'entity_test',
))->save();
])->save();
}
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\MailCaptureTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\simpletest\WebTestBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\MissingCheckedRequirementsTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\simpletest\WebTestBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\MissingDependentModuleUnitTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\simpletest\KernelTestBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\OtherInstallationProfileTestsTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\simpletest\WebTestBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\SimpleTestBrowserTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\Core\Url;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\SimpleTestInstallBatchTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\simpletest\WebTestBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\SimpleTestTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\Component\Utility\Crypt;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\TimeZoneTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\simpletest\WebTestBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\UserHelpersTest.
*/
namespace Drupal\simpletest\Tests;
use Drupal\simpletest\WebTestBase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\UserCreationTrait.
*/
namespace Drupal\simpletest;
use Drupal\Component\Utility\SafeMarkup;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\WebAssert.
*/
namespace Drupal\simpletest;
use Behat\Mink\WebAssert as MinkWebAssert;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\WebTestBase.
*/
namespace Drupal\simpletest;
use Drupal\block\Entity\Block;
@ -1179,7 +1174,7 @@ abstract class WebTestBase extends TestBase {
* @param $curl_options
* An associative array of cURL options to set, where the keys are constants
* defined by the cURL library. For a list of valid options, see
* http://www.php.net/manual/function.curl-setopt.php
* http://php.net/manual/function.curl-setopt.php
* @param $redirect
* FALSE if this is an initial request, TRUE if this request is the result
* of a redirect.

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\phpunit_test\PhpUnitTestDummyClass.
*/
namespace Drupal\phpunit_test;
class PhpUnitTestDummyClass {

View file

@ -1,5 +1,12 @@
<?php
/**
* @file
* Install hooks for test module.
*/
use Drupal\entity_test\Entity\EntityTest;
/**
* Implements hook_install().
*/
@ -22,6 +29,6 @@ function simpletest_test_install() {
* Callback for batch operations.
*/
function _simpletest_test_callback($id) {
$entity = entity_create('entity_test', array('id' => $id));
$entity = EntityTest::create(array('id' => $id));
$entity->save();
}

View file

@ -1,13 +1,8 @@
<?php
/**
* @file
* Contains \Drupal\Tests\simpletest\Functional\BrowserTestBaseTest.
*/
namespace Drupal\Tests\simpletest\Functional;
use Drupal\simpletest\BrowserTestBase;
use Drupal\Tests\BrowserTestBase;
/**
* Tests BrowserTestBase functionality.

View file

@ -0,0 +1,56 @@
<?php
namespace Drupal\Tests\simpletest\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
/**
* Tests if we can execute JavaScript in the browser.
*
* @group javascript
*/
class BrowserWithJavascriptTest extends JavascriptTestBase {
public function testJavascript() {
$this->drupalGet('<front>');
$session = $this->getSession();
$session->resizeWindow(400, 300);
$javascript = <<<JS
(function(){
var w = window,
d = document,
e = d.documentElement,
g = d.getElementsByTagName('body')[0],
x = w.innerWidth || e.clientWidth || g.clientWidth,
y = w.innerHeight || e.clientHeight|| g.clientHeight;
return x == 400 && y == 300;
}());
JS;
$this->assertJsCondition($javascript);
}
public function testAssertJsCondition() {
$this->drupalGet('<front>');
$session = $this->getSession();
$session->resizeWindow(500, 300);
$javascript = <<<JS
(function(){
var w = window,
d = document,
e = d.documentElement,
g = d.getElementsByTagName('body')[0],
x = w.innerWidth || e.clientWidth || g.clientWidth,
y = w.innerHeight || e.clientHeight|| g.clientHeight;
return x == 400 && y == 300;
}());
JS;
// We expected the following assertion to fail because the window has been
// re-sized to have a width of 500 not 400.
$this->setExpectedException(\PHPUnit_Framework_AssertionFailedError::class);
$this->assertJsCondition($javascript, 100);
}
}

View file

@ -1,14 +1,9 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\Migrate\d6\MigrateSimpletestConfigsTest.
*/
namespace Drupal\simpletest\Tests\Migrate\d6;
namespace Drupal\Tests\simpletest\Kernel\Migrate\d6;
use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Upgrade variables to simpletest.settings.yml.

View file

@ -1,13 +1,8 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\Migrate\d7\MigrateSimpletestSettingsTest.
*/
namespace Drupal\Tests\simpletest\Kernel\Migrate\d7;
namespace Drupal\simpletest\Tests\Migrate\d7;
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
/**
* Tests migration of SimpleTest's variables to configuration.

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\simpletest\Unit\PhpUnitAutoloaderTest.
*/
namespace Drupal\Tests\simpletest\Unit;
use Drupal\Tests\UnitTestCase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\simpletest\Unit\PhpUnitErrorTest.
*/
namespace Drupal\Tests\simpletest\Unit;
use Drupal\Tests\UnitTestCase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\simpletest\Unit\SimpletestPhpunitRunCommandTest.
*/
namespace Drupal\Tests\simpletest\Unit;
use Drupal\Core\DependencyInjection\ContainerBuilder;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\simpletest\Unit\TestBaseTest.
*/
namespace Drupal\Tests\simpletest\Unit;
use Drupal\Tests\UnitTestCase;

View file

@ -5,7 +5,7 @@
* Contains \Drupal\Tests\simpletest\Unit\TestInfoParsingTest.
*/
namespace Drupal\Tests\simpletest\Unit;
namespace Drupal\Tests\simpletest\Unit {
use Composer\Autoload\ClassLoader;
use Drupal\Core\Extension\Extension;
@ -87,18 +87,18 @@ class TestInfoParsingTest extends UnitTestCase {
$tests[] = [
// Expected result.
[
'name' => 'Drupal\field\Tests\BulkDeleteTest',
'group' => 'field',
'description' => 'Bulk delete storages and fields, and clean up afterwards.',
'name' => 'Drupal\simpletest\Tests\ExampleSimpleTest',
'group' => 'simpletest',
'description' => 'Tests the Simpletest UI internal browser.',
'type' => 'Simpletest',
],
// Classname.
'Drupal\field\Tests\BulkDeleteTest',
'Drupal\simpletest\Tests\ExampleSimpleTest',
// Doc block.
"/**
* Bulk delete storages and fields, and clean up afterwards.
* Tests the Simpletest UI internal browser.
*
* @group field
* @group simpletest
*/
",
];
@ -107,18 +107,19 @@ class TestInfoParsingTest extends UnitTestCase {
$tests[] = [
// Expected result.
[
'name' => 'Drupal\field\Tests\BulkDeleteTest',
'group' => 'field',
'description' => 'Bulk delete storages and fields, and clean up afterwards.',
'type' => 'Simpletest'
'name' => 'Drupal\simpletest\Tests\ExampleSimpleTest',
'group' => 'simpletest',
'description' => 'Tests the Simpletest UI internal browser.',
'type' => 'Simpletest',
],
// Classname.
'Drupal\field\Tests\BulkDeleteTest',
'Drupal\simpletest\Tests\ExampleSimpleTest',
// Doc block.
"/**
* Bulk delete storages and fields, and clean up afterwards.
* Tests the Simpletest UI internal browser.
*
* @group field
* @group simpletest
*/
*/
",
];
@ -128,18 +129,18 @@ class TestInfoParsingTest extends UnitTestCase {
$tests[] = [
// Expected result.
[
'name' => 'Drupal\field\Tests\BulkDeleteTest',
'group' => 'field',
'description' => 'Bulk delete storages and fields, and clean up afterwards. * @',
'type' => 'Simpletest'
'name' => 'Drupal\simpletest\Tests\ExampleSimpleTest',
'group' => 'simpletest',
'description' => 'Tests the Simpletest UI internal browser. * @',
'type' => 'Simpletest',
],
// Classname.
'Drupal\field\Tests\BulkDeleteTest',
'Drupal\simpletest\Tests\ExampleSimpleTest',
// Doc block.
"/**
* Bulk delete storages and fields, and clean up afterwards. * @
* Tests the Simpletest UI internal browser. * @
*
* @group field
* @group simpletest
*/
",
];
@ -148,19 +149,19 @@ class TestInfoParsingTest extends UnitTestCase {
$tests[] = [
// Expected result.
[
'name' => 'Drupal\field\Tests\BulkDeleteTest',
'name' => 'Drupal\simpletest\Tests\ExampleSimpleTest',
'group' => 'Test',
'description' => 'Bulk delete storages and fields, and clean up afterwards.',
'type' => 'Simpletest'
'description' => 'Tests the Simpletest UI internal browser.',
'type' => 'Simpletest',
],
// Classname.
'Drupal\field\Tests\BulkDeleteTest',
'Drupal\simpletest\Tests\ExampleSimpleTest',
// Doc block.
"/**
* Bulk delete storages and fields, and clean up afterwards.
* Tests the Simpletest UI internal browser.
*
* @group Test
* @group field
* @group simpletest
*/
",
];
@ -169,20 +170,20 @@ class TestInfoParsingTest extends UnitTestCase {
$tests[] = [
// Expected result.
[
'name' => 'Drupal\field\Tests\BulkDeleteTest',
'group' => 'field',
'description' => 'Bulk delete storages and fields, and clean up afterwards.',
'name' => 'Drupal\simpletest\Tests\ExampleSimpleTest',
'description' => 'Tests the Simpletest UI internal browser.',
'type' => 'Simpletest',
'requires' => ['module' => ['test']],
'type' => 'Simpletest'
'group' => 'simpletest',
],
// Classname.
'Drupal\field\Tests\BulkDeleteTest',
'Drupal\simpletest\Tests\ExampleSimpleTest',
// Doc block.
"/**
* Bulk delete storages and fields, and clean up afterwards.
* Tests the Simpletest UI internal browser.
*
* @dependencies test
* @group field
* @group simpletest
*/
",
];
@ -191,20 +192,20 @@ class TestInfoParsingTest extends UnitTestCase {
$tests[] = [
// Expected result.
[
'name' => 'Drupal\field\Tests\BulkDeleteTest',
'group' => 'field',
'description' => 'Bulk delete storages and fields, and clean up afterwards.',
'name' => 'Drupal\simpletest\Tests\ExampleSimpleTest',
'description' => 'Tests the Simpletest UI internal browser.',
'type' => 'Simpletest',
'requires' => ['module' => ['test', 'test1', 'test2']],
'type' => 'Simpletest'
'group' => 'simpletest',
],
// Classname.
'Drupal\field\Tests\BulkDeleteTest',
'Drupal\simpletest\Tests\ExampleSimpleTest',
// Doc block.
"/**
* Bulk delete storages and fields, and clean up afterwards.
* Tests the Simpletest UI internal browser.
*
* @dependencies test, test1,test2
* @group field
* @dependencies test, test1, test2
* @group simpletest
*/
",
];
@ -213,18 +214,19 @@ class TestInfoParsingTest extends UnitTestCase {
$tests[] = [
// Expected result.
[
'name' => 'Drupal\field\Tests\BulkDeleteTest',
'group' => 'field',
'description' => 'Bulk delete storages and fields, and clean up afterwards. And the summary line continues and there is no gap to the annotation.',
'type' => 'Simpletest'
'name' => 'Drupal\simpletest\Tests\ExampleSimpleTest',
'description' => 'Tests the Simpletest UI internal browser. And the summary line continues an there is no gap to the annotation.',
'type' => 'Simpletest',
'group' => 'simpletest',
],
// Classname.
'Drupal\field\Tests\BulkDeleteTest',
'Drupal\simpletest\Tests\ExampleSimpleTest',
// Doc block.
"/**
* Bulk delete storages and fields, and clean up afterwards. And the summary
* line continues and there is no gap to the annotation.
* @group field
* Tests the Simpletest UI internal browser. And the summary line continues an
* there is no gap to the annotation.
*
* @group simpletest
*/
",
];
@ -234,10 +236,10 @@ class TestInfoParsingTest extends UnitTestCase {
/**
* @covers ::getTestInfo
* @expectedException \Drupal\simpletest\Exception\MissingGroupException
* @expectedExceptionMessage Missing @group annotation in Drupal\field\Tests\BulkDeleteTest
* @expectedExceptionMessage Missing @group annotation in Drupal\KernelTests\field\BulkDeleteTest
*/
public function testTestInfoParserMissingGroup() {
$classname = 'Drupal\field\Tests\BulkDeleteTest';
$classname = 'Drupal\KernelTests\field\BulkDeleteTest';
$doc_comment = <<<EOT
/**
* Bulk delete storages and fields, and clean up afterwards.
@ -250,7 +252,7 @@ EOT;
* @covers ::getTestInfo
*/
public function testTestInfoParserMissingSummary() {
$classname = 'Drupal\field\Tests\BulkDeleteTest';
$classname = 'Drupal\KernelTests\field\BulkDeleteTest';
$doc_comment = <<<EOT
/**
* @group field
@ -410,3 +412,19 @@ class TestTestDiscovery extends TestDiscovery {
}
}
}
namespace Drupal\simpletest\Tests {
use Drupal\simpletest\WebTestBase;
/**
* Tests the Simpletest UI internal browser.
*
* @group simpletest
*/
class ExampleSimpleTest extends WebTestBase {
}
}

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\simpletest\Unit\WebTestBaseTest.
*/
namespace Drupal\Tests\simpletest\Unit;
use Drupal\Tests\UnitTestCase;