You are here

public function DiscoverServiceProvidersTest::testDiscoverServiceCustom in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php \Drupal\Tests\Core\DrupalKernel\DiscoverServiceProvidersTest::testDiscoverServiceCustom()

Tests discovery with user defined container yaml.

@covers ::discoverServiceProviders

File

core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php, line 21

Class

DiscoverServiceProvidersTest
@coversDefaultClass \Drupal\Core\DrupalKernel @group DrupalKernel

Namespace

Drupal\Tests\Core\DrupalKernel

Code

public function testDiscoverServiceCustom() {
  new Settings([
    'container_yamls' => [
      __DIR__ . '/fixtures/custom.yml',
    ],
  ]);
  $kernel = new DrupalKernel('prod', new ClassLoader());
  $kernel
    ->discoverServiceProviders();
  $expect = [
    'app' => [
      'core' => 'core/core.services.yml',
    ],
    'site' => [
      __DIR__ . '/fixtures/custom.yml',
    ],
  ];
  $this
    ->assertAttributeSame($expect, 'serviceYamls', $kernel);
}