5 use Drupal\Core\Database\Connection;
9 use PHPUnit\Framework\TestCase;
21 $connection = (
new Chain($this))
22 ->add(Connection::class,
"blah", NULL)
25 $databaseTable = (
new Chain($this))
26 ->add(DatabaseTable::class,
"blah", NULL)
29 $factory = $this->getMockBuilder(DatabaseTableFactory::class)
30 ->setConstructorArgs([$connection])
31 ->setMethods([
'getDatabaseTable'])
34 $factory->method(
'getDatabaseTable')->willReturn($databaseTable);
36 $fileStorage = $factory->getInstance(
'blah');
37 $fileStorage2 = $factory->getInstance(
'blah');
38 $this->assertEquals($fileStorage, $fileStorage2);