function SqliteDatabaseExcluderTest::register

Overrides PackageManagerKernelTestBase::register

File

core/modules/package_manager/tests/src/Kernel/PathExcluder/SqliteDatabaseExcluderTest.php, line 34

Class

SqliteDatabaseExcluderTest
@covers \Drupal\package_manager\PathExcluder\SqliteDatabaseExcluder @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel\PathExcluder

Code

public function register(ContainerBuilder $container) : void {
    parent::register($container);
    $this->mockDatabase = $this->prophesize(Connection::class);
    $this->mockDatabase
        ->driver()
        ->willReturn('sqlite')
        ->shouldBeCalled();
    $container->set('mock_database', $this->mockDatabase
        ->reveal());
    $container->getDefinition(SqliteDatabaseExcluder::class)
        ->setArgument('$database', new Reference('mock_database'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.