namespace Drupal\Tests\Component\DependencyInjection\Dumper {
use Drupal\Component\Utility\Crypt;
+ use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Parameter;
* @coversDefaultClass \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper
* @group DependencyInjection
*/
- class OptimizedPhpArrayDumperTest extends \PHPUnit_Framework_TestCase {
+ class OptimizedPhpArrayDumperTest extends TestCase {
/**
* The container builder instance.
* @covers ::getParameterCall
*
* @dataProvider getDefinitionsDataProvider
+ *
+ * @group legacy
*/
public function testGetServiceDefinitions($services, $definition_services) {
$this->containerDefinition['services'] = $definition_services;
'arguments_count' => 0,
'properties' => [],
'calls' => [],
- 'scope' => ContainerInterface::SCOPE_CONTAINER,
'shared' => TRUE,
'factory' => FALSE,
'configurator' => FALSE,
'calls' => $calls,
] + $base_service_definition;
- $service_definitions[] = [
- 'scope' => ContainerInterface::SCOPE_PROTOTYPE,
- 'shared' => FALSE,
- ] + $base_service_definition;
-
$service_definitions[] = [
'shared' => FALSE,
] + $base_service_definition;
$definition->getArguments()->willReturn($service_definition['arguments']);
$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']);
}
}
- // Remove any remaining scope.
- unset($filtered_service_definition['scope']);
-
if (isset($filtered_service_definition['public']) && $filtered_service_definition['public'] === FALSE) {
$services_provided[] = [
['foo_service' => $definition->reveal()],
];
}
- /**
- * Tests that the correct InvalidArgumentException is thrown for getScope().
- *
- * @covers ::getServiceDefinition
- */
- public function testGetServiceDefinitionWithInvalidScope() {
- $bar_definition = new Definition('\stdClass');
- $bar_definition->setScope('foo_scope');
- $services['bar'] = $bar_definition;
-
- $this->containerBuilder->getDefinitions()->willReturn($services);
- $this->setExpectedException(InvalidArgumentException::class);
- $this->dumper->getArray();
- }
-
/**
* Tests that references to aliases work correctly.
*
* @covers ::getReferenceCall
*
* @dataProvider publicPrivateDataProvider
+ *
+ * @group legacy
*/
public function testGetServiceDefinitionWithReferenceToAlias($public) {
$bar_definition = new Definition('\stdClass');
* getDecoratedService().
*
* @covers ::getServiceDefinition
+ *
+ * @group legacy
*/
public function testGetServiceDefinitionForDecoratedService() {
$bar_definition = new Definition('\stdClass');
* define a dummy, else it cannot be tested.
*/
namespace Symfony\Component\ExpressionLanguage {
+
if (!class_exists('\Symfony\Component\ExpressionLanguage\Expression')) {
/**
* Dummy class to ensure non-existent Symfony component can be tested.