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

This commit is contained in:
Pantheon Automation 2016-01-06 16:31:26 -08:00 committed by Greg Anderson
parent 1a0e9d9fac
commit a6b049dd05
538 changed files with 5247 additions and 1594 deletions

View file

@ -376,7 +376,7 @@ class DateTimePlusTest extends UnitTestCase {
// Test for invalid minute from date array.
array(array('year' => 2010, 'month' => 7, 'day' => 8, 'hour' => 8, 'minute' => 88, 'second' => 0), 'America/Chicago'),
// Regression test for https://www.drupal.org/node/2084455.
array(array('hour' => 59, 'minute' => 1,'second' => 1), 'America/Chicago'),
array(array('hour' => 59, 'minute' => 1, 'second' => 1), 'America/Chicago'),
);
}

View file

@ -49,7 +49,7 @@ class ContainerTest extends \PHPUnit_Framework_TestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->machineFormat = TRUE;
$this->containerClass = '\Drupal\Component\DependencyInjection\Container';
$this->containerDefinition = $this->getMockContainerDefinition();

View file

@ -58,7 +58,7 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
// Setup a mock container builder.
$this->containerBuilder = $this->prophesize('\Symfony\Component\DependencyInjection\ContainerBuilder');
$this->containerBuilder->getAliases()->willReturn(array());

View file

@ -18,7 +18,7 @@ class PhpArrayDumperTest extends OptimizedPhpArrayDumperTest {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->machineFormat = FALSE;
$this->dumperClass = '\Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper';
parent::setUp();

View file

@ -18,7 +18,7 @@ class PhpArrayContainerTest extends ContainerTest {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->machineFormat = FALSE;
$this->containerClass = '\Drupal\Component\DependencyInjection\PhpArrayContainer';
$this->containerDefinition = $this->getMockContainerDefinition();

View file

@ -25,7 +25,7 @@ use Symfony\Component\EventDispatcher\Tests\TestEventListener;
*
* @see https://github.com/symfony/symfony/pull/12521
*
* @group Symfony
* @group EventDispatcher
*/
class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest
{

View file

@ -81,7 +81,7 @@ class HtmlTest extends UnitTestCase {
// Verify that an identifier starting with two hyphens is replaced.
array('__cssidentifier', '--cssidentifier', array()),
// Verify that passing double underscores as a filter is processed.
array('_cssidentifier', '__cssidentifier', array('__' => '_')),
array('_cssidentifier', '__cssidentifier', array('__' => '_')),
);
}

View file

@ -30,7 +30,7 @@ class SortArrayTest extends UnitTestCase {
* The first input array for the SortArray::sortByWeightElement() method.
* @param array $b
* The second input array for the SortArray::sortByWeightElement().
* @param integer $expected
* @param int $expected
* The expected output from calling the method.
*/
public function testSortByWeightElement($a, $b, $expected) {
@ -106,7 +106,7 @@ class SortArrayTest extends UnitTestCase {
* The first input array for the SortArray::sortByWeightProperty() method.
* @param array $b
* The second input array for the SortArray::sortByWeightProperty().
* @param integer $expected
* @param int $expected
* The expected output from calling the method.
*/
public function testSortByWeightProperty($a, $b, $expected) {
@ -182,7 +182,7 @@ class SortArrayTest extends UnitTestCase {
* The first input item for comparison.
* @param array $b
* The second item for comparison.
* @param integer $expected
* @param int $expected
* The expected output from calling the method.
*/
public function testSortByTitleElement($a, $b, $expected) {
@ -251,7 +251,7 @@ class SortArrayTest extends UnitTestCase {
* The first input item for comparison.
* @param array $b
* The second item for comparison.
* @param integer $expected
* @param int $expected
* The expected output from calling the method.
*/
public function testSortByTitleProperty($a, $b, $expected) {

View file

@ -24,7 +24,7 @@ class UnicodeTest extends UnitTestCase {
*
* @covers ::check
*/
public function setUp() {
protected function setUp() {
// Initialize unicode component.
Unicode::check();
}

View file

@ -217,8 +217,8 @@ class AccessManagerTest extends UnitTestCase {
$this->assertEquals(TRUE, $this->accessManager->check($route_matches['test_route_4'], $this->account));
$this->assertEquals(AccessResult::neutral(), $this->accessManager->check($route_matches['test_route_1'], $this->account, NULL, TRUE));
$this->assertEquals(AccessResult::allowed(), $this->accessManager->check($route_matches['test_route_2'], $this->account, NULL, TRUE));
$this->assertEquals(AccessResult::forbidden(), $this->accessManager->check($route_matches['test_route_3'], $this->account, NULL, TRUE));
$this->assertEquals(AccessResult::allowed(), $this->accessManager->check($route_matches['test_route_4'], $this->account, NULL, TRUE));
$this->assertEquals(AccessResult::forbidden(), $this->accessManager->check($route_matches['test_route_3'], $this->account, NULL, TRUE));
$this->assertEquals(AccessResult::allowed(), $this->accessManager->check($route_matches['test_route_4'], $this->account, NULL, TRUE));
}
/**

View file

@ -97,9 +97,9 @@ class LibraryDependencyResolverTest extends UnitTestCase {
[['test/nested_deps_c'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c']],
[['test/nested_deps_a', 'test/nested_deps_b'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b']],
[['test/nested_deps_b', 'test/nested_deps_a'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b']],
[['test/nested_deps_a', 'test/nested_deps_c'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c']],
[['test/nested_deps_b', 'test/nested_deps_c'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c']],
[['test/nested_deps_c', 'test/nested_deps_a'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c']],
[['test/nested_deps_a', 'test/nested_deps_c'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c']],
[['test/nested_deps_b', 'test/nested_deps_c'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c']],
[['test/nested_deps_c', 'test/nested_deps_a'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c']],
[['test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c']],
[['test/nested_deps_a', 'test/nested_deps_c', 'test/nested_deps_b'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c']],
[['test/nested_deps_b', 'test/nested_deps_a', 'test/nested_deps_c'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c']],
@ -107,7 +107,7 @@ class LibraryDependencyResolverTest extends UnitTestCase {
[['test/nested_deps_c', 'test/nested_deps_a', 'test/nested_deps_b'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c']],
[['test/nested_deps_c', 'test/nested_deps_b', 'test/nested_deps_a'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c']],
// Complex dependencies, combining the above, with many intersections.
[['test/deps_c', 'test/nested_deps_b'], ['test/no_deps_b', 'test/no_deps_a', 'test/deps_c', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b']],
[['test/deps_c', 'test/nested_deps_b'], ['test/no_deps_b', 'test/no_deps_a', 'test/deps_c', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b']],
[['test/no_deps_a', 'test/deps_c', 'test/nested_deps_b'], ['test/no_deps_a', 'test/no_deps_b', 'test/deps_c', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b']],
[['test/nested_deps_b', 'test/deps_c', 'test/no_deps_c'], ['test/no_deps_a', 'test/deps_a', 'test/nested_deps_a', 'test/nested_deps_b', 'test/no_deps_b', 'test/deps_c', 'test/no_deps_c']],
];
@ -149,9 +149,9 @@ class LibraryDependencyResolverTest extends UnitTestCase {
[['test/nested_deps_c'], ['test/nested_deps_c']],
[['test/nested_deps_a', 'test/nested_deps_b'], ['test/nested_deps_b']],
[['test/nested_deps_b', 'test/nested_deps_a'], ['test/nested_deps_b']],
[['test/nested_deps_a', 'test/nested_deps_c'], ['test/nested_deps_c']],
[['test/nested_deps_b', 'test/nested_deps_c'], ['test/nested_deps_c']],
[['test/nested_deps_c', 'test/nested_deps_a'], ['test/nested_deps_c']],
[['test/nested_deps_a', 'test/nested_deps_c'], ['test/nested_deps_c']],
[['test/nested_deps_b', 'test/nested_deps_c'], ['test/nested_deps_c']],
[['test/nested_deps_c', 'test/nested_deps_a'], ['test/nested_deps_c']],
[['test/nested_deps_a', 'test/nested_deps_b', 'test/nested_deps_c'], ['test/nested_deps_c']],
[['test/nested_deps_a', 'test/nested_deps_c', 'test/nested_deps_b'], ['test/nested_deps_c']],
[['test/nested_deps_b', 'test/nested_deps_a', 'test/nested_deps_c'], ['test/nested_deps_c']],
@ -159,7 +159,7 @@ class LibraryDependencyResolverTest extends UnitTestCase {
[['test/nested_deps_c', 'test/nested_deps_a', 'test/nested_deps_b'], ['test/nested_deps_c']],
[['test/nested_deps_c', 'test/nested_deps_b', 'test/nested_deps_a'], ['test/nested_deps_c']],
// Complex dependencies, combining the above, with many intersections.
[['test/deps_c', 'test/nested_deps_b'], ['test/deps_c', 'test/nested_deps_b']],
[['test/deps_c', 'test/nested_deps_b'], ['test/deps_c', 'test/nested_deps_b']],
[['test/no_deps_a', 'test/deps_c', 'test/nested_deps_b'], ['test/deps_c', 'test/nested_deps_b']],
[['test/nested_deps_b', 'test/deps_c', 'test/no_deps_c'], ['test/nested_deps_b', 'test/deps_c', 'test/no_deps_c']],
];

View file

@ -56,7 +56,7 @@ class ConfigFactoryTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->storage = $this->getMock('Drupal\Core\Config\StorageInterface');
$this->eventDispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->typedConfig = $this->getMock('\Drupal\Core\Config\TypedConfigManagerInterface');

View file

@ -58,7 +58,7 @@ class ConfigTest extends UnitTestCase {
*/
protected $cacheTagsInvalidator;
public function setUp() {
protected function setUp() {
$this->storage = $this->getMock('Drupal\Core\Config\StorageInterface');
$this->eventDispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->typedConfig = $this->getMock('\Drupal\Core\Config\TypedConfigManagerInterface');

View file

@ -163,6 +163,7 @@ class ConfigEntityTypeTest extends UnitTestCase {
'status' => 'status',
'dependencies' => 'dependencies',
'third_party_settings' => 'third_party_settings',
'_core' => '_core',
'id' => 'id',
'custom_property' => 'customProperty',
],

View file

@ -33,7 +33,7 @@ class StackedKernelPassTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->stackedKernelPass = new StackedKernelPass();
$this->containerBuilder = new ContainerBuilder();
}

View file

@ -145,7 +145,7 @@ class EntityFieldManagerTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->container = $this->prophesize(ContainerInterface::class);

View file

@ -76,13 +76,13 @@ class ModuleRouteSubscriberTest extends UnitTestCase {
return array(
array('enabled', array('_module_dependencies' => 'enabled'), FALSE),
array('disabled', array('_module_dependencies' => 'disabled'), TRUE),
array('enabled_or', array('_module_dependencies' => 'disabled,enabled'), FALSE),
array('enabled_or', array('_module_dependencies' => 'enabled,disabled'), FALSE),
array('disabled_or', array('_module_dependencies' => 'disabled,disabled'), TRUE),
array('enabled_and', array('_module_dependencies' => 'enabled+enabled'), FALSE),
array('enabled_and', array('_module_dependencies' => 'enabled+disabled'), TRUE),
array('enabled_and', array('_module_dependencies' => 'disabled+enabled'), TRUE),
array('disabled_and', array('_module_dependencies' => 'disabled+disabled'), TRUE),
array('enabled_or', array('_module_dependencies' => 'disabled,enabled'), FALSE),
array('enabled_or', array('_module_dependencies' => 'enabled,disabled'), FALSE),
array('disabled_or', array('_module_dependencies' => 'disabled,disabled'), TRUE),
array('enabled_and', array('_module_dependencies' => 'enabled+enabled'), FALSE),
array('enabled_and', array('_module_dependencies' => 'enabled+disabled'), TRUE),
array('enabled_and', array('_module_dependencies' => 'disabled+enabled'), TRUE),
array('disabled_and', array('_module_dependencies' => 'disabled+disabled'), TRUE),
array('no_dependencies', array(), FALSE),
);
}

View file

@ -33,7 +33,7 @@ class PsrResponseSubscriberTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$factory = $this->getMock('Symfony\Bridge\PsrHttpMessage\HttpFoundationFactoryInterface', [], [], '', NULL);
$factory
->expects($this->any())

View file

@ -14,8 +14,6 @@ use Drupal\Tests\UnitTestCase;
/**
* @coversDefaultClass \Drupal\Core\Form\FormCache
* @group Form
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
*/
class FormCacheTest extends UnitTestCase {
@ -89,6 +87,16 @@ class FormCacheTest extends UnitTestCase {
*/
protected $requestPolicy;
/**
* {@inheritdoc}
*/
protected $runTestInSeparateProcess = TRUE;
/**
* {@inheritdoc}
*/
protected $preserveGlobalState = FALSE;
/**
* {@inheritdoc}
*/

View file

@ -27,7 +27,7 @@ class ClientFactoryTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$stack = $this->getMockBuilder('GuzzleHttp\HandlerStack')
->disableOriginalConstructor()
->getMock();

View file

@ -47,7 +47,7 @@ class ImageTest extends UnitTestCase {
protected $toolkitOperation;
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function setUp() {
// Use the Druplicon image.

View file

@ -32,7 +32,7 @@ class ChainRequestPolicyTest extends UnitTestCase {
*/
protected $request;
public function setUp() {
protected function setUp() {
$this->policy = new ChainRequestPolicy();
$this->request = new Request();
}

View file

@ -40,7 +40,7 @@ class ChainResponsePolicyTest extends UnitTestCase {
*/
protected $response;
public function setUp() {
protected function setUp() {
$this->policy = new ChainResponsePolicy();
$this->response = new Response();
$this->request = new Request();

View file

@ -24,7 +24,7 @@ class CommandLineOrUnsafeMethodTest extends UnitTestCase {
*/
protected $policy;
public function setUp() {
protected function setUp() {
// Note that it is necessary to partially mock the class under test in
// order to disable the isCli-check.
$this->policy = $this->getMock('Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod', array('isCli'));

View file

@ -32,7 +32,7 @@ class NoSessionOpenTest extends UnitTestCase {
*/
protected $policy;
public function setUp() {
protected function setUp() {
$this->sessionConfiguration = $this->getMock('Drupal\Core\Session\SessionConfigurationInterface');
$this->policy = new RequestPolicy\NoSessionOpen($this->sessionConfiguration);
}

View file

@ -43,7 +43,7 @@ class ContextTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->typedDataManager = $this->getMockBuilder('Drupal\Core\TypedData\TypedDataManager')

View file

@ -49,7 +49,7 @@ class AccessAwareRouterTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
parent::setUp();
$this->route = new Route('test');
$this->accessManager = $this->getMock('Drupal\Core\Access\AccessManagerInterface');

View file

@ -32,7 +32,7 @@ class WriteSafeSessionHandlerTest extends UnitTestCase {
*/
protected $sessionHandler;
public function setUp() {
protected function setUp() {
$this->wrappedSessionHandler = $this->getMock('SessionHandlerInterface');
$this->sessionHandler = new WriteSafeSessionHandler($this->wrappedSessionHandler);
}

View file

@ -27,7 +27,7 @@ class ReverseProxyMiddlewareTest extends UnitTestCase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp() {
$this->mockHttpKernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
}

View file

@ -7,6 +7,7 @@
namespace Drupal\Tests\Core\Template;
use Drupal\Core\Template\Attribute;
use Drupal\Core\Template\TwigSandboxPolicy;
use Drupal\Core\Template\Loader\StringLoader;
use Drupal\Tests\UnitTestCase;
@ -64,6 +65,13 @@ class TwigSandboxTest extends UnitTestCase {
];
}
/**
* Tests that white listed classes can be extended.
*/
public function testExtendedClass() {
$this->twig->render('{{ attribute.addClass("kitten") }}', ['attribute' => new TestAttribute()]);
}
/**
* Tests that prefixed methods can be called from within Twig templates.
*
@ -133,3 +141,5 @@ class TwigSandboxTest extends UnitTestCase {
}
}
class TestAttribute extends Attribute {}