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

File diff suppressed because it is too large Load diff

View file

@ -11,7 +11,7 @@ use Drupal\Component\Assertion\Inspector;
/**
* @coversDefaultClass \Drupal\Component\Assertion\Inspector
* @group Inspector
* @group Assertion
*/
class InspectorTest extends PHPUnit_Framework_TestCase {

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Bridge\ZfExtensionManagerSfContainerTest.
*/
namespace Drupal\Tests\Component\Bridge;
use Drupal\Component\Bridge\ZfExtensionManagerSfContainer;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Datetime\DateTimePlusTest.
*/
namespace Drupal\Tests\Component\Datetime;
use Drupal\Tests\UnitTestCase;

View file

@ -9,7 +9,6 @@ namespace Drupal\Tests\Component\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Prophecy\Argument;
/**
@ -132,7 +131,7 @@ class ContainerTest extends \PHPUnit_Framework_TestCase {
*
* @covers ::setParameter
*
* @expectedException LogicException
* @expectedException \Symfony\Component\DependencyInjection\Exception\LogicException
*/
public function testSetParameterWithFrozenContainer() {
$this->container = new $this->containerClass($this->containerDefinition);

View file

@ -266,6 +266,10 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
'synthetic' => TRUE,
) + $base_service_definition;
$service_definitions[] = array(
'shared' => FALSE,
) + $base_service_definition;
$service_definitions[] = array(
'lazy' => TRUE,
) + $base_service_definition;
@ -358,6 +362,10 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
'shared' => FALSE,
) + $base_service_definition;
$service_definitions[] = array(
'shared' => FALSE,
) + $base_service_definition;
// Test factory.
$service_definitions[] = array(
'factory' => array(new Reference('bar'), 'factoryMethod'),
@ -397,6 +405,7 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
$definition->getProperties()->willReturn($service_definition['properties']);
$definition->getMethodCalls()->willReturn($service_definition['calls']);
$definition->getScope()->willReturn($service_definition['scope']);
$definition->isShared()->willReturn($service_definition['shared']);
$definition->getDecoratedService()->willReturn(NULL);
$definition->getFactory()->willReturn($service_definition['factory']);
$definition->getConfigurator()->willReturn($service_definition['configurator']);

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\DependencyInjection\Dumper\PhpArrayDumperTest.
*/
namespace Drupal\Tests\Component\DependencyInjection\Dumper;
use Symfony\Component\DependencyInjection\ContainerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\DependencyInjection\PhpArrayContainerTest.
*/
namespace Drupal\Tests\Component\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Diff\Engine\DiffEngineTest.
*/
namespace Drupal\Tests\Component\Diff\Engine;
use Drupal\Component\Diff\Engine\DiffEngine;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Diff\Engine\DiffOpTest.
*/
namespace Drupal\Tests\Component\Diff\Engine;
use Drupal\Component\Diff\Engine\DiffOp;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Diff\Engine\DiffOpTest.
*/
namespace Drupal\Tests\Component\Diff\Engine;
use Drupal\Component\Diff\Engine\HWLDFWordAccumulator;

View file

@ -0,0 +1,152 @@
<?php
namespace Drupal\Tests\Component\Discovery;
use Drupal\Component\Discovery\DiscoveryException;
use Drupal\Component\Discovery\YamlDirectoryDiscovery;
use Drupal\Tests\UnitTestCase;
use org\bovigo\vfs\vfsStream;
/**
* YamlDirectoryDiscoveryTest component unit tests.
*
* @coversDefaultClass \Drupal\Component\Discovery\YamlDirectoryDiscovery
*
* @group Discovery
*/
class YamlDirectoryDiscoveryTest extends UnitTestCase {
/**
* Tests YAML directory discovery.
*
* @covers ::findAll
*/
public function testDiscovery() {
vfsStream::setup('modules', NULL, [
'test_1' => [
'subdir1' => [
'item_1.test.yml' => "id: item1\nname: 'test1 item 1'",
],
'subdir2' => [
'item_2.test.yml' => "id: item2\nname: 'test1 item 2'",
],
],
'test_2' => [
'subdir1' => [
'item_3.test.yml' => "id: item3\nname: 'test2 item 3'",
],
'subdir2' => [],
],
'test_3' => [],
'test_4' => [
'subdir1' => [
'item_4.test.yml' => "id: item4\nname: 'test4 item 4'",
'item_5.test.yml' => "id: item5\nname: 'test4 item 5'",
'item_6.test.yml' => "id: item6\nname: 'test4 item 6'",
],
],
]);
// Set up the directories to search.
$directories = [
// Multiple directories both with valid items.
'test_1' => [
vfsStream::url('modules/test_1/subdir1'),
vfsStream::url('modules/test_1/subdir2'),
],
// The subdir2 directory is empty.
'test_2' => [
vfsStream::url('modules/test_2/subdir1'),
vfsStream::url('modules/test_2/subdir2'),
],
// Directories that do not exist.
'test_3' => [
vfsStream::url('modules/test_3/subdir1'),
vfsStream::url('modules/test_3/subdir2'),
],
// A single directory.
'test_4' => vfsStream::url('modules/test_4/subdir1'),
];
$discovery = new YamlDirectoryDiscovery($directories, 'test');
$data = $discovery->findAll();
$this->assertSame(['id' => 'item1', 'name' => 'test1 item 1', YamlDirectoryDiscovery::FILE_KEY => 'vfs://modules/test_1/subdir1/item_1.test.yml'], $data['test_1']['item1']);
$this->assertSame(['id' => 'item2', 'name' => 'test1 item 2', YamlDirectoryDiscovery::FILE_KEY => 'vfs://modules/test_1/subdir2/item_2.test.yml'], $data['test_1']['item2']);
$this->assertCount(2, $data['test_1']);
$this->assertSame(['id' => 'item3', 'name' => 'test2 item 3', YamlDirectoryDiscovery::FILE_KEY => 'vfs://modules/test_2/subdir1/item_3.test.yml'], $data['test_2']['item3']);
$this->assertCount(1, $data['test_2']);
$this->assertTrue(empty($data['test_3']), 'test_3 provides 0 items');
$this->assertSame(['id' => 'item4', 'name' => 'test4 item 4', YamlDirectoryDiscovery::FILE_KEY => 'vfs://modules/test_4/subdir1/item_4.test.yml'], $data['test_4']['item4']);
$this->assertSame(['id' => 'item5', 'name' => 'test4 item 5', YamlDirectoryDiscovery::FILE_KEY => 'vfs://modules/test_4/subdir1/item_5.test.yml'], $data['test_4']['item5']);
$this->assertSame(['id' => 'item6', 'name' => 'test4 item 6', YamlDirectoryDiscovery::FILE_KEY => 'vfs://modules/test_4/subdir1/item_6.test.yml'], $data['test_4']['item6']);
$this->assertCount(3, $data['test_4']);
}
/**
* Tests YAML directory discovery with an alternate ID key.
*
* @covers ::findAll
*/
public function testDiscoveryAlternateId() {
vfsStream::setup('modules', NULL, [
'test_1' => [
'item_1.test.yml' => "alt_id: item1\nid: ignored",
],
]);
// Set up the directories to search.
$directories = ['test_1' => vfsStream::url('modules/test_1')];
$discovery = new YamlDirectoryDiscovery($directories, 'test', 'alt_id');
$data = $discovery->findAll();
$this->assertSame(['alt_id' => 'item1', 'id' => 'ignored', YamlDirectoryDiscovery::FILE_KEY => 'vfs://modules/test_1/item_1.test.yml'], $data['test_1']['item1']);
$this->assertCount(1, $data['test_1']);
}
/**
* Tests YAML directory discovery with a missing ID key.
*
* @covers ::findAll
* @covers ::getIdentifier
*/
public function testDiscoveryNoIdException() {
$this->setExpectedException(DiscoveryException::class, 'The vfs://modules/test_1/item_1.test.yml contains no data in the identifier key \'id\'');
vfsStream::setup('modules', NULL, [
'test_1' => [
'item_1.test.yml' => "",
],
]);
// Set up the directories to search.
$directories = ['test_1' => vfsStream::url('modules/test_1')];
$discovery = new YamlDirectoryDiscovery($directories, 'test');
$discovery->findAll();
}
/**
* Tests YAML directory discovery with invalid YAML.
*
* @covers ::findAll
*/
public function testDiscoveryInvalidYamlException() {
$this->setExpectedException(DiscoveryException::class, 'The vfs://modules/test_1/item_1.test.yml contains invalid YAML');
vfsStream::setup('modules', NULL, [
'test_1' => [
'item_1.test.yml' => "id: invalid\nfoo : [bar}",
],
]);
// Set up the directories to search.
$directories = ['test_1' => vfsStream::url('modules/test_1')];
$discovery = new YamlDirectoryDiscovery($directories, 'test');
$discovery->findAll();
}
}

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Discovery\YamlDiscoveryTest.
*/
namespace Drupal\Tests\Component\Discovery;
use Drupal\Tests\UnitTestCase;

View file

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

View file

@ -1,18 +1,13 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\EventDispatcher\ContainerAwareEventDispatcherTest.
*/
namespace Drupal\Tests\Component\EventDispatcher;
use Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\EventDispatcher\Tests\AbstractEventDispatcherTest;
use Symfony\Component\EventDispatcher\Tests\CallableClass;
use Symfony\Component\EventDispatcher\Tests\TestEventListener;
use Symfony\Component\EventDispatcher\Tests\ContainerAwareEventDispatcherTest as SymfonyContainerAwareEventDispatcherTest;
/**
* Unit tests for the ContainerAwareEventDispatcher.
@ -27,7 +22,7 @@ use Symfony\Component\EventDispatcher\Tests\TestEventListener;
*
* @group EventDispatcher
*/
class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest
class ContainerAwareEventDispatcherTest extends SymfonyContainerAwareEventDispatcherTest
{
protected function createEventDispatcher()
{
@ -175,4 +170,11 @@ class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest
$otherService = $container->get('other_listener_service');
$this->assertTrue($otherService->preFooInvoked);
}
}
public function testGetListenerPriority()
{
// Override the parent test as our implementation doesn't define
// getListenerPriority().
}
}

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\FileCache\FileCacheFactoryTest.
*/
namespace Drupal\Tests\Component\FileCache;
use Drupal\Component\FileCache\FileCacheFactory;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\FileCache\FileCacheTest.
*/
namespace Drupal\Tests\Component\FileCache;
use Drupal\Component\FileCache\FileCache;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\FileCache\StaticFileCacheBackend.
*/
namespace Drupal\Tests\Component\FileCache;
use Drupal\Component\FileCache\FileCacheBackendInterface;

View file

@ -0,0 +1,109 @@
<?php
namespace Drupal\Tests\Component\FileSystem;
use Drupal\Component\FileSystem\RegexDirectoryIterator;
use Drupal\Tests\UnitTestCase;
use org\bovigo\vfs\vfsStream;
/**
* @coversDefaultClass \Drupal\Component\FileSystem\RegexDirectoryIterator
* @group FileSystem
*/
class RegexDirectoryIteratorTest extends UnitTestCase {
/**
* @covers ::accept
* @dataProvider providerTestRegexDirectoryIterator
*/
public function testRegexDirectoryIterator(array $directory, $regex, array $expected) {
vfsStream::setup('root', NULL, $directory);
$iterator = new RegexDirectoryIterator(vfsStream::url('root'), $regex);
// Create an array of filenames to assert against.
$file_list = array_map(function(\SplFileInfo $file) {
return $file->getFilename();
}, array_values(iterator_to_array($iterator)));
$this->assertSame($expected, $file_list);
}
/**
* Provider for self::testRegexDirectoryIterator().
*/
public function providerTestRegexDirectoryIterator() {
return [
[
[
'1.yml' => '',
],
'/\.yml$/',
[
'1.yml',
],
],
[
[
'1.yml' => '',
'2.yml' => '',
'3.txt' => '',
],
'/\.yml$/',
[
'1.yml',
'2.yml',
],
],
[
[
'1.yml' => '',
'2.yml' => '',
'3.txt' => '',
],
'/\.txt/',
[
'3.txt',
],
],
[
[
'1.yml' => '',
// Ensure we don't recurse in directories even if that match the
// regex.
'2.yml' => [
'3.yml' => '',
'4.yml' => '',
],
'3.txt' => '',
],
'/\.yml$/',
[
'1.yml',
],
],
[
[
'1.yml' => '',
'2.yml' => '',
'3.txt' => '',
],
'/^\d/',
[
'1.yml',
'2.yml',
'3.txt'
],
],
[
[
'1.yml' => '',
'2.yml' => '',
'3.txt' => '',
],
'/^\D/',
[],
],
];
}
}

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Gettext\PoHeaderTest.
*/
namespace Drupal\Tests\Component\Gettext;
use Drupal\Component\Gettext\PoHeader;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Graph\GraphTest.
*/
namespace Drupal\Tests\Component\Graph;
use Drupal\Component\Graph\Graph;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\PhpStorage\FileStorageReadOnlyTest.
*/
namespace Drupal\Tests\Component\PhpStorage;
use Drupal\Component\PhpStorage\FileStorage;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\PhpStorage\FileStorageTest.
*/
namespace Drupal\Tests\Component\PhpStorage;
use Drupal\Component\PhpStorage\FileStorage;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\PhpStorage\MTimeProtectedFastFileStorageTest.
*/
namespace Drupal\Tests\Component\PhpStorage;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\PhpStorage\MTimeProtectedFileStorageBase.
*/
namespace Drupal\Tests\Component\PhpStorage;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\PhpStorage\MTimeProtectedFileStorageTest.
*/
namespace Drupal\Tests\Component\PhpStorage;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\PhpStorage\PhpStorageTestBase.
*/
namespace Drupal\Tests\Component\PhpStorage;
use Drupal\Component\PhpStorage\PhpStorageInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Plugin\Context\ContextTest.
*/
namespace Drupal\Tests\Component\Plugin\Context;
use Drupal\Component\Plugin\Context\Context;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Plugin\DefaultFactoryTest.
*/
namespace Drupal\Tests\Component\Plugin;
use Drupal\Component\Plugin\Definition\PluginDefinitionInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Plugin\Discovery\DiscoveryCachedTraitTest.
*/
namespace Drupal\Tests\Component\Plugin\Discovery;
use Drupal\Tests\UnitTestCase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Plugin\Discovery\DiscoveryTraitTest.
*/
namespace Drupal\Tests\Component\Plugin\Discovery;
use Drupal\Tests\UnitTestCase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Plugin\Discovery\StaticDiscoveryDecoratorTest.
*/
namespace Drupal\Tests\Component\Plugin\Discovery;
use Drupal\Tests\UnitTestCase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Plugin\PluginBaseTest.
*/
namespace Drupal\Tests\Component\Plugin;
use Drupal\Tests\UnitTestCase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Plugin\PluginManagerBaseTest.
*/
namespace Drupal\Tests\Component\Plugin;
use Drupal\Component\Plugin\Exception\PluginNotFoundException;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Plugin\StubFallbackPluginManager.
*/
namespace Drupal\Tests\Component\Plugin;
use Drupal\Component\Plugin\FallbackPluginManagerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Render\FormattableMarkupTest.
*/
namespace Drupal\Tests\Component\Render;
use Drupal\Component\Render\FormattableMarkup;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Render\HtmlEscapedTextTest.
*/
namespace Drupal\Tests\Component\Render;
use Drupal\Component\Render\HtmlEscapedText;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Render\PlainTextOutputTest.
*/
namespace Drupal\Tests\Component\Render;
use Drupal\Component\Render\PlainTextOutput;

View file

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

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Serialization\YamlTest.
*/
namespace Drupal\Tests\Component\Serialization;
use Drupal\Component\Serialization\Yaml;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Transliteration\PhpTransliterationTest.
*/
namespace Drupal\Tests\Component\Transliteration;
use Drupal\Component\Transliteration\PhpTransliteration;
@ -118,7 +113,7 @@ class PhpTransliterationTest extends UnitTestCase {
// http://www.unicode.org/charts/PDF/U1400.pdf
$four_byte = html_entity_decode('&#x1411;', ENT_NOQUOTES, 'UTF-8');
// These are two Gothic alphabet letters. See
// http://en.wikipedia.org/wiki/Gothic_alphabet
// http://wikipedia.org/wiki/Gothic_alphabet
// They are not in our tables, but should at least give us '?' (unknown).
$five_byte = html_entity_decode('&#x10330;&#x10338;', ENT_NOQUOTES, 'UTF-8');

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,12 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Utility\NumberTest.
*
* @see \Drupal\Component\Utility\Number
*/
namespace Drupal\Tests\Component\Utility;
use Drupal\Component\Utility\Number;
@ -18,6 +11,8 @@ use Drupal\Tests\UnitTestCase;
* @group Utility
*
* @coversDefaultClass \Drupal\Component\Utility\Number
*
* @see \Drupal\Component\Utility\Number
*/
class NumberTest extends UnitTestCase {

View file

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

File diff suppressed because it is too large Load diff

View file

@ -138,7 +138,7 @@ class SafeMarkupTest extends UnitTestCase {
$result = SafeMarkup::format($string, $args);
$this->assertEquals($expected, $result, $message);
$this->assertEquals($expected_is_safe, SafeMarkup::isSafe($result), 'SafeMarkup::format correctly sets the result as safe or not safe.');
$this->assertEquals($expected_is_safe, $result instanceof MarkupInterface, 'SafeMarkup::format correctly sets the result as safe or not safe.');
foreach ($args as $arg) {
$this->assertSame($arg instanceof SafeMarkupTestMarkup, SafeMarkup::isSafe($arg));

View file

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

View file

@ -1,8 +1,4 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Utility\TextWrapper.
*/
namespace Drupal\Tests\Component\Utility;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Utility\TimerTest.
*/
namespace Drupal\Tests\Component\Utility;
use Drupal\Tests\UnitTestCase;
@ -39,7 +34,7 @@ class TimerTest extends UnitTestCase {
// Although we sleep for 5 milliseconds, we should test that at least 4 ms
// have past because usleep() is not reliable on Windows. See
// http://php.net/manual/en/function.usleep.php for more information. The
// http://php.net/manual/function.usleep.php for more information. The
// purpose of the test to validate that the Timer class can measure elapsed
// time not the granularity of usleep() on a particular OS.
$this->assertGreaterThanOrEqual(4, $value, 'Timer failed to measure at least 4 milliseconds of sleeping while running.');

View file

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

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Utility\UrlHelperTest.
*/
namespace Drupal\Tests\Component\Utility;
use Drupal\Component\Utility\UrlHelper;
@ -246,7 +241,7 @@ class UrlHelperTest extends UnitTestCase {
*/
public function testParse($url, $expected) {
$parsed = UrlHelper::parse($url);
$this->assertEquals($expected, $parsed, 'The url was not properly parsed.');
$this->assertEquals($expected, $parsed, 'The URL was not properly parsed.');
}
/**

View file

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

View file

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

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Component\Uuid\UuidTest.
*/
namespace Drupal\Tests\Component\Uuid;
use Drupal\Component\Uuid\Uuid;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\ComposerIntegrationTest.
*/
namespace Drupal\Tests;
/**
@ -49,9 +44,23 @@ class ComposerIntegrationTest extends UnitTestCase {
return [
$this->root,
$this->root . '/core',
$this->root . '/core/lib/Drupal/Component/Annotation',
$this->root . '/core/lib/Drupal/Component/Assertion',
$this->root . '/core/lib/Drupal/Component/Bridge',
$this->root . '/core/lib/Drupal/Component/Datetime',
$this->root . '/core/lib/Drupal/Component/Diff',
$this->root . '/core/lib/Drupal/Component/Discovery',
$this->root . '/core/lib/Drupal/Component/EventDispatcher',
$this->root . '/core/lib/Drupal/Component/FileCache',
$this->root . '/core/lib/Drupal/Component/Gettext',
$this->root . '/core/lib/Drupal/Component/Graph',
$this->root . '/core/lib/Drupal/Component/HttpFoundation',
$this->root . '/core/lib/Drupal/Component/PhpStorage',
$this->root . '/core/lib/Drupal/Component/Plugin',
$this->root . '/core/lib/Drupal/Component/ProxyBuilder',
$this->root . '/core/lib/Drupal/Component/Render',
$this->root . '/core/lib/Drupal/Component/Serialization',
$this->root . '/core/lib/Drupal/Component/Transliteration',
$this->root . '/core/lib/Drupal/Component/Utility',
];
}

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Access\CsrfAccessCheckTest.
*/
namespace Drupal\Tests\Core\Access;
use Drupal\Core\Access\AccessResult;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Access\CsrfTokenGeneratorTest.
*/
namespace Drupal\Tests\Core\Access;
use Drupal\Core\Site\Settings;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Access\DefaultAccessCheckTest.
*/
namespace Drupal\Tests\Core\Access;
use Drupal\Core\Access\AccessResult;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Access\RouteProcessorCsrfTest.
*/
namespace Drupal\Tests\Core\Access;
use Drupal\Core\Render\BubbleableMetadata;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Ajax\AjaxCommandsTest.
*/
namespace Drupal\Tests\Core\Ajax;
use Drupal\Tests\UnitTestCase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Ajax\AjaxResponseTest.
*/
namespace Drupal\Tests\Core\Ajax;
use Drupal\Core\Ajax\AjaxResponse;

View file

@ -0,0 +1,66 @@
<?php
namespace Drupal\Tests\Core\Annotation;
use Drupal\Core\Annotation\PluralTranslation;
use Drupal\Tests\UnitTestCase;
/**
* @coversDefaultClass \Drupal\Core\Annotation\PluralTranslation
* @group Annotation
*/
class PluralTranslationTest extends UnitTestCase {
/**
* @covers ::get
*
* @dataProvider providerTestGet
*/
public function testGet(array $values) {
$annotation = new PluralTranslation($values);
$default_values = [
'context' => NULL,
];
$this->assertEquals($values + $default_values, $annotation->get());
}
/**
* Provides data to self::testGet().
*/
public function providerTestGet() {
$data = [];
$data[] = [
[
'singular' => $this->randomMachineName(),
'plural' => $this->randomMachineName(),
'context' => $this->randomMachineName(),
],
];
$data[] = [
[
'singular' => $this->randomMachineName(),
'plural' => $this->randomMachineName(),
],
];
return $data;
}
/**
* @dataProvider providerTestMissingData
*/
public function testMissingData($data) {
$this->setExpectedException(\InvalidArgumentException::class);
new PluralTranslation($data);
}
public function providerTestMissingData() {
$data = [];
$data['all-missing'] = [[]];
$data['singular-missing'] = [['plural' => 'muh']];
$data['plural-missing'] = [['singular' => 'muh']];
return $data;
}
}

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Annotation\TranslationTest.
*/
namespace Drupal\Tests\Core\Annotation;
use Drupal\Core\Annotation\Translation;

View file

@ -1,11 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Asset\CssCollectionGrouperUnitTest.
*/
namespace Drupal\Tests\Core\Asset;
use Drupal\Core\Asset\CssCollectionGrouper;
@ -46,15 +40,15 @@ class CssCollectionGrouperUnitTest extends UnitTestCase {
'browsers' => array('IE' => TRUE, '!IE' => TRUE),
'basename' => 'system.base.css',
),
'system.theme.css' => array(
'js.module.css' => array(
'group' => -100,
'type' => 'file',
'weight' => 0.013,
'media' => 'all',
'preprocess' => TRUE,
'data' => 'core/modules/system/system.theme.css',
'data' => 'core/modules/system/js.module.css',
'browsers' => array('IE' => TRUE, '!IE' => TRUE),
'basename' => 'system.theme.css',
'basename' => 'js.module.css',
),
'jquery.ui.core.css' => array(
'group' => -100,
@ -120,7 +114,7 @@ class CssCollectionGrouperUnitTest extends UnitTestCase {
$this->assertSame($group['preprocess'], TRUE);
$this->assertSame(count($group['items']), 3);
$this->assertContains($css_assets['system.base.css'], $group['items']);
$this->assertContains($css_assets['system.theme.css'], $group['items']);
$this->assertContains($css_assets['js.module.css'], $group['items']);
// Check group 2.
$group = $groups[1];

View file

@ -1,11 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Asset\CssCollectionRendererUnitTest.
*/
namespace {
/**

View file

@ -1,11 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Asset\CssOptimizerUnitTest.
*/
namespace {
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Asset\JsOptimizerUnitTest.
*/
namespace Drupal\Tests\Core\Asset;
use Drupal\Core\Asset\JsOptimizer;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Asset\LibraryDependencyResolverTest.
*/
namespace Drupal\Tests\Core\Asset;
use Drupal\Core\Asset\LibraryDependencyResolver;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Asset\LibraryDiscoveryCollectorTest.
*/
namespace Drupal\Tests\Core\Asset;
use Drupal\Core\Asset\LibraryDiscoveryCollector;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Asset\LibraryDiscoveryTest.
*/
namespace Drupal\Tests\Core\Asset;
use Drupal\Core\Asset\LibraryDiscovery;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Batch\PercentagesTest.
*/
namespace Drupal\Tests\Core\Batch;
use Drupal\Core\Batch\Percentage;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Block\BlockBaseTest.
*/
namespace Drupal\Tests\Core\Block;
use Drupal\block_test\Plugin\Block\TestBlockInstantiation;

View file

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

View file

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

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Cache\BackendChainImplementationUnitTest.
*/
namespace Drupal\Tests\Core\Cache;
use Drupal\Core\Cache\BackendChain;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Cache\CacheCollectorHelper.
*/
namespace Drupal\Tests\Core\Cache;
use Drupal\Core\Cache\CacheCollector;

View file

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

View file

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

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Cache\CacheTagsInvalidatorTest.
*/
namespace Drupal\Tests\Core\Cache;
use Drupal\Core\Cache\CacheTagsInvalidator;

View file

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

View file

@ -1,17 +1,11 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Cache\CacheableMetadataTest.
*/
namespace Drupal\Tests\Core\Cache;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Tests\Core\Render\TestCacheableDependency;
use Drupal\Tests\UnitTestCase;
use Drupal\Core\Render\Element;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Cache\ChainedFastBackendTest.
*/
namespace Drupal\Tests\Core\Cache;
use Drupal\Core\Cache\ChainedFastBackend;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Cache\NullBackendTest.
*/
namespace Drupal\Tests\Core\Cache;
use Drupal\Core\Cache\NullBackend;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Common\AttributesTest.
*/
namespace Drupal\Tests\Core\Common;
use Drupal\Core\Template\Attribute;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Common\DiffArrayTest.
*/
namespace Drupal\Tests\Core\Common;
use Drupal\Component\Utility\DiffArray;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Common\TagsTest.
*/
namespace Drupal\Tests\Core\Common;
use Drupal\Component\Utility\Tags;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Config\CachedStorageTest.
*/
namespace Drupal\Tests\Core\Config;
use Drupal\Tests\UnitTestCase;

View file

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

View file

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

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Config\Entity\ConfigDependencyManagerTest.
*/
namespace Drupal\Tests\Core\Config\Entity;
use Drupal\Tests\UnitTestCase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Config\Entity\ConfigEntityDependencyTest.
*/
namespace Drupal\Tests\Core\Config\Entity;
use Drupal\Tests\UnitTestCase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Config\Entity\ConfigEntityStorageTest.
*/
namespace Drupal\Tests\Core\Config\Entity {
use Drupal\Core\Cache\Cache;
@ -854,7 +849,8 @@ class ConfigEntityStorageTest extends UnitTestCase {
* @covers ::doDelete
*/
public function testDelete() {
// Dependencies are tested in \Drupal\config\Tests\ConfigDependencyTest.
// Dependencies are tested in
// \Drupal\Tests\config\Kernel\ConfigDependencyTest.
$this->configManager->expects($this->any())
->method('getConfigEntitiesToChangeOnDependencyRemoval')
->willReturn(['update' => [], 'delete' => [], 'unchanged' => []]);

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Config\Entity\ConfigEntityTypeTest.
*/
namespace Drupal\Tests\Core\Config\Entity;
use Drupal\Tests\UnitTestCase;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Config\Entity\EntityDisplayBaseTest.
*/
namespace Drupal\Tests\Core\Config\Entity;
use Drupal\Tests\UnitTestCase;

Some files were not shown because too many files have changed in this diff Show more