Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023

This commit is contained in:
Pantheon Automation 2015-09-04 13:20:09 -07:00 committed by Greg Anderson
parent 2720a9ec4b
commit f3791f1da3
1898 changed files with 54300 additions and 11481 deletions

View file

@ -23,6 +23,22 @@ class BrowserTest extends WebTestBase {
*/
protected static $cookieSet = FALSE;
/**
* Modules to enable.
*
* @var string[]
*/
public static $modules = ['block'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->drupalPlaceBlock('local_tasks_block');
}
/**
* Test \Drupal\simpletest\WebTestBase::getAbsoluteUrl().
*/

View file

@ -7,6 +7,7 @@
namespace Drupal\simpletest\Tests;
use Drupal\Core\Database\Database;
use Drupal\simpletest\KernelTestBase;
/**
@ -324,4 +325,39 @@ EOS;
$this->assertNull(drupal_get_profile());
}
/**
* {@inheritdoc}
*/
public function run(array $methods = array()) {
parent::run($methods);
// Check that all tables of the test instance have been deleted. At this
// point the original database connection is restored so we need to prefix
// the tables.
$connection = Database::getConnection();
if ($connection->databaseType() != 'sqlite') {
$tables = $connection->schema()->findTables($this->databasePrefix . '%');
$this->assertTrue(empty($tables), 'All test tables have been removed.');
}
else {
// We don't have the test instance connection anymore so we have to
// re-attach its database and then use the same query as
// \Drupal\Core\Database\Driver\sqlite\Schema::findTables().
// @see \Drupal\Core\Database\Driver\sqlite\Connection::__construct()
$info = Database::getConnectionInfo();
$connection->query('ATTACH DATABASE :database AS :prefix', [
':database' => $info['default']['database'] . '-' . $this->databasePrefix,
':prefix' => $this->databasePrefix
]);
$result = $connection->query("SELECT name FROM " . $this->databasePrefix . ".sqlite_master WHERE type = :type AND name LIKE :table_name AND name NOT LIKE :pattern", array(
':type' => 'table',
':table_name' => '%',
':pattern' => 'sqlite_%',
))->fetchAllKeyed(0, 0);
$this->assertTrue(empty($result), 'All test tables have been removed.');
}
}
}

View file

@ -13,7 +13,7 @@ use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
/**
* Upgrade variables to simpletest.settings.yml.
*
* @group simpletest
* @group migrate_drupal_6
*/
class MigrateSimpletestConfigsTest extends MigrateDrupal6TestBase {
@ -33,7 +33,6 @@ class MigrateSimpletestConfigsTest extends MigrateDrupal6TestBase {
parent::setUp();
$this->installConfig(['simpletest']);
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_simpletest_settings');
}

View file

@ -0,0 +1,42 @@
<?php
/**
* @file
* Contains \Drupal\simpletest\Tests\Migrate\d7\MigrateSimpletestSettingsTest.
*/
namespace Drupal\simpletest\Tests\Migrate\d7;
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
/**
* Tests migration of SimpleTest's variables to configuration.
*
* @group simpletest
*/
class MigrateSimpletestSettingsTest extends MigrateDrupal7TestBase {
public static $modules = ['simpletest'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installConfig(static::$modules);
$this->executeMigration('d7_simpletest_settings');
}
/**
* Tests migration of SimpleTest settings to configuration.
*/
public function testMigration() {
$config = \Drupal::config('simpletest.settings')->get();
$this->assertTrue($config['clear_results']);
$this->assertIdentical(CURLAUTH_BASIC, $config['httpauth']['method']);
$this->assertIdentical('testbot', $config['httpauth']['username']);
$this->assertIdentical('foobaz', $config['httpauth']['password']);
$this->assertTrue($config['verbose']);
}
}

View file

@ -164,7 +164,16 @@ EOD;
$site_path = $this->container->get('site.path');
file_put_contents($key_file, $private_key);
// This causes the first of the fifteen passes asserted in
// Check to see if runtime assertions are indeed on, if successful this
// will be the first of sixteen passes asserted in confirmStubResults()
try {
assert(FALSE, 'Lorem Ipsum');
$this->fail('Runtime assertions are not working.');
}
catch (\AssertionError $e) {
$this->assertEqual($e->getMessage(), 'Lorem Ipsum', 'Runtime assertions Enabled and running.');
}
// This causes the second of the sixteen passes asserted in
// confirmStubResults().
$this->pass($this->passMessage);
@ -175,7 +184,7 @@ EOD;
// confirmStubResults().
$this->fail($this->failMessage);
// This causes the second to fourth of the fifteen passes asserted in
// This causes the third to fifth of the sixteen passes asserted in
// confirmStubResults().
$user = $this->drupalCreateUser(array($this->validPermission), 'SimpleTestTest');
@ -183,15 +192,15 @@ EOD;
$this->drupalCreateUser(array($this->invalidPermission));
// Test logging in as a user.
// This causes the fifth to ninth of the fifteen passes asserted in
// This causes the sixth to tenth of the sixteen passes asserted in
// confirmStubResults().
$this->drupalLogin($user);
// This causes the tenth of the fifteen passes asserted in
// This causes the eleventh of the sixteen passes asserted in
// confirmStubResults().
$this->pass(t('Test ID is @id.', array('@id' => $this->testId)));
// These cause the eleventh to fourteenth of the fifteen passes asserted in
// These cause the twelfth to fifteenth of the sixteen passes asserted in
// confirmStubResults().
$this->assertTrue(file_exists($site_path . '/settings.testing.php'));
// Check the settings.testing.php file got included.
@ -206,7 +215,7 @@ EOD;
// Generates a warning inside a PHP function.
array_key_exists(NULL, NULL);
// This causes the fifteenth of the fifteen passes asserted in
// This causes the sixteenth of the sixteen passes asserted in
// confirmStubResults().
$this->assertNothing();
@ -250,7 +259,7 @@ EOD;
$this->assertAssertion("Debug: 'Foo'", 'Debug', 'Fail', 'SimpleTestTest.php', 'Drupal\simpletest\Tests\SimpleTestTest->stubTest()');
$this->assertEqual('15 passes, 3 fails, 2 exceptions, 3 debug messages', $this->childTestResults['summary']);
$this->assertEqual('16 passes, 3 fails, 2 exceptions, 3 debug messages', $this->childTestResults['summary']);
$this->testIds[] = $test_id = $this->getTestIdFromResults();
$this->assertTrue($test_id, 'Found test ID in results.');