Issue #2488860 by alexpott, dawehner, catch, Mile23, jgeryk, claudiu.cristea, daffie, jibran: Bring phpunit bridge into drupal and use it for unit tests and simpletest to handle Deprecation
parent
5424560a97
commit
e63e65fa37
|
@ -4173,6 +4173,68 @@
|
||||||
"description": "Symfony DomCrawler Component",
|
"description": "Symfony DomCrawler Component",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"time": "2017-02-21T09:12:04+00:00"
|
"time": "2017-02-21T09:12:04+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/phpunit-bridge",
|
||||||
|
"version": "v3.2.8",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/phpunit-bridge.git",
|
||||||
|
"reference": "00916603c524b8048906de460b7ea0dfa1651281"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/00916603c524b8048906de460b7ea0dfa1651281",
|
||||||
|
"reference": "00916603c524b8048906de460b7ea0dfa1651281",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.3"
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"phpunit/phpunit": ">=6.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-zip": "Zip support is required when using bin/simple-phpunit",
|
||||||
|
"symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader"
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"bin/simple-phpunit"
|
||||||
|
],
|
||||||
|
"type": "symfony-bridge",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "3.2-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"bootstrap.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Bridge\\PhpUnit\\": ""
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Grekas",
|
||||||
|
"email": "p@tchwork.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Symfony PHPUnit Bridge",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"time": "2017-04-12T14:13:17+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
|
|
|
@ -45,7 +45,8 @@
|
||||||
"jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
|
"jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
|
||||||
"mikey179/vfsStream": "~1.2",
|
"mikey179/vfsStream": "~1.2",
|
||||||
"phpunit/phpunit": ">=4.8.35 <5",
|
"phpunit/phpunit": ">=4.8.35 <5",
|
||||||
"symfony/css-selector": "3.2.6"
|
"symfony/css-selector": "3.2.6",
|
||||||
|
"symfony/phpunit-bridge": "^3.2"
|
||||||
},
|
},
|
||||||
"replace": {
|
"replace": {
|
||||||
"drupal/action": "self.version",
|
"drupal/action": "self.version",
|
||||||
|
|
|
@ -17,8 +17,8 @@ class YamlSymfony implements SerializationInterface {
|
||||||
*/
|
*/
|
||||||
public static function encode($data) {
|
public static function encode($data) {
|
||||||
try {
|
try {
|
||||||
$yaml = new Dumper();
|
// Set the indentation to 2 to match Drupal's coding standards.
|
||||||
$yaml->setIndentation(2);
|
$yaml = new Dumper(2);
|
||||||
return $yaml->dump($data, PHP_INT_MAX, 0, SymfonyYaml::DUMP_EXCEPTION_ON_INVALID_TYPE);
|
return $yaml->dump($data, PHP_INT_MAX, 0, SymfonyYaml::DUMP_EXCEPTION_ON_INVALID_TYPE);
|
||||||
}
|
}
|
||||||
catch (\Exception $e) {
|
catch (\Exception $e) {
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
|
|
||||||
namespace Drupal\Tests\migrate\Unit\process;
|
namespace Drupal\Tests\migrate\Unit\process;
|
||||||
|
|
||||||
@trigger_error('The ' . __NAMESPACE__ . '\DedupeEntityTest is deprecated in
|
|
||||||
Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use ' . __NAMESPACE__ . '\MakeUniqueEntityFieldTest', E_USER_DEPRECATED);
|
|
||||||
|
|
||||||
use Drupal\Core\Entity\EntityStorageInterface;
|
use Drupal\Core\Entity\EntityStorageInterface;
|
||||||
use Drupal\Core\Entity\EntityTypeManagerInterface;
|
use Drupal\Core\Entity\EntityTypeManagerInterface;
|
||||||
use Drupal\Core\Entity\Query\QueryInterface;
|
use Drupal\Core\Entity\Query\QueryInterface;
|
||||||
|
@ -14,6 +11,7 @@ use Drupal\Component\Utility\Unicode;
|
||||||
/**
|
/**
|
||||||
* @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\DedupeEntity
|
* @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\DedupeEntity
|
||||||
* @group migrate
|
* @group migrate
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
class DedupeEntityTest extends MigrateProcessTestCase {
|
class DedupeEntityTest extends MigrateProcessTestCase {
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
|
|
||||||
namespace Drupal\Tests\migrate\Unit\process;
|
namespace Drupal\Tests\migrate\Unit\process;
|
||||||
|
|
||||||
@trigger_error('The ' . __NAMESPACE__ . '\MigrationTest is deprecated in
|
|
||||||
Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use ' . __NAMESPACE__ . '\MigrationLookupTest', E_USER_DEPRECATED);
|
|
||||||
|
|
||||||
use Drupal\Core\Entity\EntityStorageInterface;
|
use Drupal\Core\Entity\EntityStorageInterface;
|
||||||
use Drupal\migrate\MigrateSkipProcessException;
|
use Drupal\migrate\MigrateSkipProcessException;
|
||||||
use Drupal\migrate\Plugin\MigrationInterface;
|
use Drupal\migrate\Plugin\MigrationInterface;
|
||||||
|
@ -17,11 +14,9 @@ use Drupal\migrate\Plugin\MigrationPluginManagerInterface;
|
||||||
use Prophecy\Argument;
|
use Prophecy\Argument;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated in Drupal 8.4.x, to be removed before Drupal 9.0.x. Use
|
|
||||||
* \Drupal\Tests\migrate\Unit\process\MigrationLookupTest instead.
|
|
||||||
*
|
|
||||||
* @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\Migration
|
* @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\Migration
|
||||||
* @group migrate
|
* @group migrate
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
class MigrationTest extends MigrateProcessTestCase {
|
class MigrationTest extends MigrateProcessTestCase {
|
||||||
|
|
||||||
|
|
|
@ -35,9 +35,9 @@ class UiPhpUnitOutputTest extends WebTestBase {
|
||||||
|
|
||||||
// Check that there are <br> tags for the HTML output by
|
// Check that there are <br> tags for the HTML output by
|
||||||
// SimpletestUiPrinter.
|
// SimpletestUiPrinter.
|
||||||
$this->assertEqual($output[18], 'HTML output was generated<br />');
|
$this->assertEqual($output[19], 'HTML output was generated<br />');
|
||||||
// Check that URLs are printed as HTML links.
|
// Check that URLs are printed as HTML links.
|
||||||
$this->assertIdentical(strpos($output[19], '<a href="http'), 0);
|
$this->assertIdentical(strpos($output[20], '<a href="http'), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ use Prophecy\Argument;
|
||||||
/**
|
/**
|
||||||
* @coversDefaultClass \Drupal\text\Plugin\migrate\cckfield\TextField
|
* @coversDefaultClass \Drupal\text\Plugin\migrate\cckfield\TextField
|
||||||
* @group text
|
* @group text
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
class TextFieldTest extends UnitTestCase {
|
class TextFieldTest extends UnitTestCase {
|
||||||
|
|
||||||
|
|
|
@ -49,9 +49,6 @@ views.display.page:
|
||||||
context:
|
context:
|
||||||
type: string
|
type: string
|
||||||
label: 'Context'
|
label: 'Context'
|
||||||
expanded:
|
|
||||||
type: boolean
|
|
||||||
label: 'Expanded'
|
|
||||||
tab_options:
|
tab_options:
|
||||||
type: mapping
|
type: mapping
|
||||||
label: 'Tab options'
|
label: 'Tab options'
|
||||||
|
|
|
@ -31,14 +31,6 @@ views.filter.combine:
|
||||||
type: string
|
type: string
|
||||||
label: 'Field'
|
label: 'Field'
|
||||||
|
|
||||||
views.filter_value.date:
|
|
||||||
type: views.filter_value.numeric
|
|
||||||
label: 'Date'
|
|
||||||
mapping:
|
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
label: 'Type'
|
|
||||||
|
|
||||||
views.filter_value.groupby_numeric:
|
views.filter_value.groupby_numeric:
|
||||||
type: views.filter_value.numeric
|
type: views.filter_value.numeric
|
||||||
label: 'Group by numeric'
|
label: 'Group by numeric'
|
||||||
|
|
|
@ -59,7 +59,6 @@ display:
|
||||||
type: string
|
type: string
|
||||||
settings:
|
settings:
|
||||||
link_to_entity: true
|
link_to_entity: true
|
||||||
plugin_id: field
|
|
||||||
filters:
|
filters:
|
||||||
type:
|
type:
|
||||||
id: type
|
id: type
|
||||||
|
|
|
@ -45,6 +45,8 @@
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
<listeners>
|
<listeners>
|
||||||
|
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
|
||||||
|
</listener>
|
||||||
<listener class="\Drupal\Tests\Listeners\DrupalStandardsListener">
|
<listener class="\Drupal\Tests\Listeners\DrupalStandardsListener">
|
||||||
</listener>
|
</listener>
|
||||||
</listeners>
|
</listeners>
|
||||||
|
|
|
@ -212,6 +212,8 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
|
||||||
* @covers ::getParameterCall
|
* @covers ::getParameterCall
|
||||||
*
|
*
|
||||||
* @dataProvider getDefinitionsDataProvider
|
* @dataProvider getDefinitionsDataProvider
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testGetServiceDefinitions($services, $definition_services) {
|
public function testGetServiceDefinitions($services, $definition_services) {
|
||||||
$this->containerDefinition['services'] = $definition_services;
|
$this->containerDefinition['services'] = $definition_services;
|
||||||
|
@ -477,6 +479,8 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
|
||||||
* @covers ::getReferenceCall
|
* @covers ::getReferenceCall
|
||||||
*
|
*
|
||||||
* @dataProvider publicPrivateDataProvider
|
* @dataProvider publicPrivateDataProvider
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testGetServiceDefinitionWithReferenceToAlias($public) {
|
public function testGetServiceDefinitionWithReferenceToAlias($public) {
|
||||||
$bar_definition = new Definition('\stdClass');
|
$bar_definition = new Definition('\stdClass');
|
||||||
|
@ -532,6 +536,8 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
|
||||||
* getDecoratedService().
|
* getDecoratedService().
|
||||||
*
|
*
|
||||||
* @covers ::getServiceDefinition
|
* @covers ::getServiceDefinition
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testGetServiceDefinitionForDecoratedService() {
|
public function testGetServiceDefinitionForDecoratedService() {
|
||||||
$bar_definition = new Definition('\stdClass');
|
$bar_definition = new Definition('\stdClass');
|
||||||
|
|
|
@ -66,6 +66,7 @@ class YamlTest extends UnitTestCase {
|
||||||
* @dataProvider providerYamlFilesInCore
|
* @dataProvider providerYamlFilesInCore
|
||||||
*/
|
*/
|
||||||
public function testYamlFiles($file) {
|
public function testYamlFiles($file) {
|
||||||
|
file_put_contents('/tmp/dup.txt', $file . "\n", FILE_APPEND);
|
||||||
$data = file_get_contents($file);
|
$data = file_get_contents($file);
|
||||||
try {
|
try {
|
||||||
$this->assertEquals(YamlSymfony::decode($data), YamlPecl::decode($data), $file);
|
$this->assertEquals(YamlSymfony::decode($data), YamlPecl::decode($data), $file);
|
||||||
|
|
|
@ -14,6 +14,7 @@ use PHPUnit_Framework_ExpectationFailedException;
|
||||||
/**
|
/**
|
||||||
* @coversDefaultClass \Drupal\FunctionalTests\AssertLegacyTrait
|
* @coversDefaultClass \Drupal\FunctionalTests\AssertLegacyTrait
|
||||||
* @group Assert
|
* @group Assert
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
class AssertLegacyTraitTest extends UnitTestCase {
|
class AssertLegacyTraitTest extends UnitTestCase {
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,8 @@ class ControllerResolverTest extends UnitTestCase {
|
||||||
*
|
*
|
||||||
* @see \Drupal\Core\Controller\ControllerResolver::getArguments()
|
* @see \Drupal\Core\Controller\ControllerResolver::getArguments()
|
||||||
* @see \Drupal\Core\Controller\ControllerResolver::doGetArguments()
|
* @see \Drupal\Core\Controller\ControllerResolver::doGetArguments()
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testGetArguments() {
|
public function testGetArguments() {
|
||||||
$controller = function(EntityInterface $entity, $user, RouteMatchInterface $route_match, ServerRequestInterface $psr_7) {
|
$controller = function(EntityInterface $entity, $user, RouteMatchInterface $route_match, ServerRequestInterface $psr_7) {
|
||||||
|
@ -220,6 +222,8 @@ class ControllerResolverTest extends UnitTestCase {
|
||||||
*
|
*
|
||||||
* @covers ::getArguments
|
* @covers ::getArguments
|
||||||
* @covers ::doGetArguments
|
* @covers ::doGetArguments
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testGetArgumentsWithRouteMatchAndRequest() {
|
public function testGetArgumentsWithRouteMatchAndRequest() {
|
||||||
$request = Request::create('/test');
|
$request = Request::create('/test');
|
||||||
|
@ -233,6 +237,8 @@ class ControllerResolverTest extends UnitTestCase {
|
||||||
*
|
*
|
||||||
* @covers ::getArguments
|
* @covers ::getArguments
|
||||||
* @covers ::doGetArguments
|
* @covers ::doGetArguments
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testGetArgumentsWithRouteMatchAndPsr7Request() {
|
public function testGetArgumentsWithRouteMatchAndPsr7Request() {
|
||||||
$request = Request::create('/test');
|
$request = Request::create('/test');
|
||||||
|
|
|
@ -261,6 +261,8 @@ class AttributeTest extends UnitTestCase {
|
||||||
*
|
*
|
||||||
* @covers ::removeClass
|
* @covers ::removeClass
|
||||||
* @covers ::addClass
|
* @covers ::addClass
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testTwigAddRemoveClasses($template, $expected, $seed_attributes = []) {
|
public function testTwigAddRemoveClasses($template, $expected, $seed_attributes = []) {
|
||||||
$loader = new \Twig_Loader_String();
|
$loader = new \Twig_Loader_String();
|
||||||
|
|
|
@ -15,6 +15,7 @@ use Drupal\Tests\UnitTestCase;
|
||||||
* Tests the twig extension.
|
* Tests the twig extension.
|
||||||
*
|
*
|
||||||
* @group Template
|
* @group Template
|
||||||
|
* @group legacy
|
||||||
*
|
*
|
||||||
* @coversDefaultClass \Drupal\Core\Template\TwigExtension
|
* @coversDefaultClass \Drupal\Core\Template\TwigExtension
|
||||||
*/
|
*/
|
||||||
|
@ -73,6 +74,8 @@ class TwigExtensionTest extends UnitTestCase {
|
||||||
* Tests the escaping
|
* Tests the escaping
|
||||||
*
|
*
|
||||||
* @dataProvider providerTestEscaping
|
* @dataProvider providerTestEscaping
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testEscaping($template, $expected) {
|
public function testEscaping($template, $expected) {
|
||||||
$twig = new \Twig_Environment(NULL, [
|
$twig = new \Twig_Environment(NULL, [
|
||||||
|
@ -123,6 +126,8 @@ class TwigExtensionTest extends UnitTestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the active_theme function.
|
* Tests the active_theme function.
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testActiveTheme() {
|
public function testActiveTheme() {
|
||||||
$active_theme = $this->getMockBuilder('\Drupal\Core\Theme\ActiveTheme')
|
$active_theme = $this->getMockBuilder('\Drupal\Core\Theme\ActiveTheme')
|
||||||
|
@ -183,6 +188,8 @@ class TwigExtensionTest extends UnitTestCase {
|
||||||
* Tests the escaping of objects implementing MarkupInterface.
|
* Tests the escaping of objects implementing MarkupInterface.
|
||||||
*
|
*
|
||||||
* @covers ::escapeFilter
|
* @covers ::escapeFilter
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testSafeStringEscaping() {
|
public function testSafeStringEscaping() {
|
||||||
$twig = new \Twig_Environment(NULL, [
|
$twig = new \Twig_Environment(NULL, [
|
||||||
|
@ -267,6 +274,8 @@ class TwigExtensionTest extends UnitTestCase {
|
||||||
/**
|
/**
|
||||||
* @covers ::escapeFilter
|
* @covers ::escapeFilter
|
||||||
* @covers ::bubbleArgMetadata
|
* @covers ::bubbleArgMetadata
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testEscapeWithGeneratedLink() {
|
public function testEscapeWithGeneratedLink() {
|
||||||
$twig = new \Twig_Environment(NULL, [
|
$twig = new \Twig_Environment(NULL, [
|
||||||
|
|
|
@ -16,6 +16,7 @@ use Drupal\Tests\UnitTestCase;
|
||||||
* Tests the twig sandbox policy.
|
* Tests the twig sandbox policy.
|
||||||
*
|
*
|
||||||
* @group Template
|
* @group Template
|
||||||
|
* @group legacy
|
||||||
*
|
*
|
||||||
* @coversDefaultClass \Drupal\Core\Template\TwigSandboxPolicy
|
* @coversDefaultClass \Drupal\Core\Template\TwigSandboxPolicy
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue