Update to Drupal 8.2.0. For more information, see https://www.drupal.org/project/drupal/releases/8.2.0
This commit is contained in:
parent
2f563ab520
commit
f1c8716f57
1732 changed files with 52334 additions and 11780 deletions
|
@ -1,82 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\simpletest\Functional;
|
||||
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\Tests\BrowserTestBase;
|
||||
|
||||
/**
|
||||
* Tests BrowserTestBase functionality.
|
||||
*
|
||||
* @group simpletest
|
||||
*/
|
||||
class BrowserTestBaseTest extends BrowserTestBase {
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('test_page_test', 'form_test');
|
||||
|
||||
/**
|
||||
* Tests basic page test.
|
||||
*/
|
||||
public function testGoTo() {
|
||||
$account = $this->drupalCreateUser();
|
||||
$this->drupalLogin($account);
|
||||
|
||||
// Visit a Drupal page that requires login.
|
||||
$this->drupalGet('test-page');
|
||||
$this->assertSession()->statusCodeEquals(200);
|
||||
|
||||
// Test page contains some text.
|
||||
$this->assertSession()->pageTextContains('Test page text.');
|
||||
|
||||
// Check that returned plain text is correct.
|
||||
$text = $this->getTextContent();
|
||||
$this->assertContains('Test page text.', $text);
|
||||
$this->assertNotContains('</html>', $text);
|
||||
|
||||
// Response includes cache tags that we can assert.
|
||||
$this->assertSession()->responseHeaderEquals('X-Drupal-Cache-Tags', 'rendered');
|
||||
|
||||
// Test that we can read the JS settings.
|
||||
$js_settings = $this->getDrupalSettings();
|
||||
$this->assertSame('azAZ09();.,\\\/-_{}', $js_settings['test-setting']);
|
||||
|
||||
// Test drupalGet with a url object.
|
||||
$url = Url::fromRoute('test_page_test.render_title');
|
||||
$this->drupalGet($url);
|
||||
$this->assertSession()->statusCodeEquals(200);
|
||||
|
||||
// Test page contains some text.
|
||||
$this->assertSession()->pageTextContains('Hello Drupal');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests basic form functionality.
|
||||
*/
|
||||
public function testForm() {
|
||||
// Ensure the proper response code for a _form route.
|
||||
$this->drupalGet('form-test/object-builder');
|
||||
$this->assertSession()->statusCodeEquals(200);
|
||||
|
||||
// Ensure the form and text field exist.
|
||||
$this->assertSession()->elementExists('css', 'form#form-test-form-test-object');
|
||||
$this->assertSession()->fieldExists('bananas');
|
||||
|
||||
$edit = ['bananas' => 'green'];
|
||||
$this->submitForm($edit, 'Save', 'form-test-form-test-object');
|
||||
|
||||
$config_factory = $this->container->get('config.factory');
|
||||
$value = $config_factory->get('form_test.object')->get('bananas');
|
||||
$this->assertSame('green', $value);
|
||||
}
|
||||
|
||||
public function testError() {
|
||||
$this->setExpectedException('\Exception', 'User notice: foo');
|
||||
$this->drupalGet('test-error');
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
@ -60,13 +60,13 @@ class TestInfoParsingTest extends UnitTestCase {
|
|||
$tests[] = [
|
||||
// Expected result.
|
||||
[
|
||||
'name' => 'Drupal\Tests\simpletest\Functional\BrowserTestBaseTest',
|
||||
'group' => 'simpletest',
|
||||
'name' => 'Drupal\FunctionalTests\BrowserTestBaseTest',
|
||||
'group' => 'browsertestbase',
|
||||
'description' => 'Tests BrowserTestBase functionality.',
|
||||
'type' => 'PHPUnit-Functional',
|
||||
],
|
||||
// Classname.
|
||||
'Drupal\Tests\simpletest\Functional\BrowserTestBaseTest',
|
||||
'Drupal\FunctionalTests\BrowserTestBaseTest',
|
||||
];
|
||||
|
||||
// kernel PHPUnit test.
|
||||
|
@ -400,7 +400,7 @@ class TestTestDiscovery extends TestDiscovery {
|
|||
$data['simpletest-kerneltest'] = ['\Drupal\hal\Tests\FileNormalizeTest', FALSE];
|
||||
$data['module-unittest'] = [static::class, 'Unit'];
|
||||
$data['module-kerneltest'] = ['\Drupal\KernelTests\Core\Theme\TwigMarkupInterfaceTest', 'Kernel'];
|
||||
$data['module-functionaltest'] = ['\Drupal\Tests\simpletest\Functional\BrowserTestBaseTest', 'Functional'];
|
||||
$data['module-functionaltest'] = ['\Drupal\FunctionalTests\BrowserTestBaseTest', 'Functional'];
|
||||
$data['module-functionaljavascripttest'] = ['\Drupal\Tests\toolbar\FunctionalJavascript\ToolbarIntegrationTest', 'FunctionalJavascript'];
|
||||
$data['core-unittest'] = ['\Drupal\Tests\ComposerIntegrationTest', 'Unit'];
|
||||
$data['core-unittest2'] = ['Drupal\Tests\Core\DrupalTest', 'Unit'];
|
||||
|
@ -413,9 +413,7 @@ class TestTestDiscovery extends TestDiscovery {
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace Drupal\simpletest\Tests {
|
||||
namespace Drupal\simpletest\Tests;
|
||||
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
||||
|
@ -426,5 +424,3 @@ use Drupal\simpletest\WebTestBase;
|
|||
*/
|
||||
class ExampleSimpleTest extends WebTestBase {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue