function DatabaseBackendFactoryTest::testGet

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php \Drupal\Tests\Core\Cache\DatabaseBackendFactoryTest::testGet()
  2. 8.9.x core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php \Drupal\Tests\Core\Cache\DatabaseBackendFactoryTest::testGet()
  3. 11.x core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php \Drupal\Tests\Core\Cache\DatabaseBackendFactoryTest::testGet()

@covers ::__construct @covers ::get @dataProvider getProvider

File

core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php, line 27

Class

DatabaseBackendFactoryTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Cache%21DatabaseBackendFactory.php/class/DatabaseBackendFactory/10" title="DatabaseBackendFactory" class="local">\Drupal\Core\Cache\DatabaseBackendFactory</a> @group Cache

Namespace

Drupal\Tests\Core\Cache

Code

public function testGet(array $settings, $expected_max_rows_foo, $expected_max_rows_bar) : void {
    $database_backend_factory = new DatabaseBackendFactory($this->prophesize(Connection::class)
        ->reveal(), $this->prophesize(CacheTagsChecksumInterface::class)
        ->reveal(), new Settings($settings), new PhpSerialize(), $this->prophesize(TimeInterface::class)
        ->reveal());
    $this->assertSame($expected_max_rows_foo, $database_backend_factory->get('foo')
        ->getMaxRows());
    $this->assertSame($expected_max_rows_bar, $database_backend_factory->get('bar')
        ->getMaxRows());
}

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