Skip to content

Commit acaca79

Browse files
committed
small fix
1 parent 25af74e commit acaca79

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

tests/e2e/Adapter/SharedTables/MongoDBTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static function getAdapterName(): string
3030
* @return Database
3131
* @throws Exception
3232
*/
33-
public static function getDatabase(): Database
33+
public function getDatabase(): Database
3434
{
3535
if (!is_null(self::$database)) {
3636
return self::$database;
@@ -53,6 +53,7 @@ public static function getDatabase(): Database
5353

5454
$database = new Database(new Mongo($client), $cache);
5555
$database
56+
->setAuthorization(self::$authorization)
5657
->setDatabase($schema)
5758
->setSharedTables(true)
5859
->setTenant(999)
@@ -73,10 +74,10 @@ public static function getDatabase(): Database
7374
public function testCreateExistsDelete(): void
7475
{
7576
// Mongo creates databases on the fly, so exists would always pass. So we override this test to remove the exists check.
76-
$this->assertNotNull(static::getDatabase()->create());
77-
$this->assertEquals(true, static::getDatabase()->delete($this->testDatabase));
78-
$this->assertEquals(true, static::getDatabase()->create());
79-
$this->assertEquals(static::getDatabase(), static::getDatabase()->setDatabase($this->testDatabase));
77+
$this->assertNotNull($this->getDatabase()->create());
78+
$this->assertEquals(true, $this->getDatabase()->delete($this->testDatabase));
79+
$this->assertEquals(true, $this->getDatabase()->create());
80+
$this->assertEquals($this->getDatabase(), $this->getDatabase()->setDatabase($this->testDatabase));
8081
}
8182

8283
public function testRenameAttribute(): void
@@ -99,12 +100,12 @@ public function testKeywords(): void
99100
$this->assertTrue(true);
100101
}
101102

102-
protected static function deleteColumn(string $collection, string $column): bool
103+
protected function deleteColumn(string $collection, string $column): bool
103104
{
104105
return true;
105106
}
106107

107-
protected static function deleteIndex(string $collection, string $index): bool
108+
protected function deleteIndex(string $collection, string $index): bool
108109
{
109110
return true;
110111
}

0 commit comments

Comments
 (0)