Security update for Core, with self-updated composer
[yaffs-website] / web / core / tests / Drupal / Tests / Component / DependencyInjection / Dumper / OptimizedPhpArrayDumperTest.php
index 9da4c27bc16dc4404277906e67ca95b0b1c4e6dd..3c447527487cb68628c57f28ba2e29cdfca7b44a 100644 (file)
@@ -8,6 +8,7 @@
 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;
@@ -21,7 +22,7 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
    * @coversDefaultClass \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper
    * @group DependencyInjection
    */
-  class OptimizedPhpArrayDumperTest extends \PHPUnit_Framework_TestCase {
+  class OptimizedPhpArrayDumperTest extends TestCase {
 
     /**
      * The container builder instance.
@@ -211,6 +212,8 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
      * @covers ::getParameterCall
      *
      * @dataProvider getDefinitionsDataProvider
+     *
+     * @group legacy
      */
     public function testGetServiceDefinitions($services, $definition_services) {
       $this->containerDefinition['services'] = $definition_services;
@@ -248,7 +251,6 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
         'arguments_count' => 0,
         'properties' => [],
         'calls' => [],
-        'scope' => ContainerInterface::SCOPE_CONTAINER,
         'shared' => TRUE,
         'factory' => FALSE,
         'configurator' => FALSE,
@@ -360,11 +362,6 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
         'calls' => $calls,
       ] + $base_service_definition;
 
-      $service_definitions[] = [
-        'scope' => ContainerInterface::SCOPE_PROTOTYPE,
-        'shared' => FALSE,
-      ] + $base_service_definition;
-
       $service_definitions[] = [
           'shared' => FALSE,
         ] + $base_service_definition;
@@ -407,7 +404,6 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
         $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']);
@@ -440,9 +436,6 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
           }
         }
 
-        // 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()],
@@ -480,27 +473,14 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
       ];
     }
 
-    /**
-     * 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');
@@ -556,6 +536,8 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
      * getDecoratedService().
      *
      * @covers ::getServiceDefinition
+     *
+     * @group legacy
      */
     public function testGetServiceDefinitionForDecoratedService() {
       $bar_definition = new Definition('\stdClass');
@@ -664,6 +646,7 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
  * 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.