You are here

public function DiscoverServiceProvidersTest::testDiscoverServiceCustom in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 25
Contains \Drupal\Tests\Core\DrupalKernel\DiscoverServiceProvidersTest.

Class

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

Namespace

Drupal\Tests\Core\DrupalKernel

Code

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