"mydb", "other_info" => 42]; $dbs = [$db1]; $this->assertSame($db1, LuticateApplication::getDatabase($db1["name"], $dbs)); } public function testGetDatabases2() { $db1 = ["name" => "mydb", "other_info" => 42]; $dbs = [$db1]; $this->assertNull(LuticateApplication::getDatabase("db", $dbs)); } public function testGetDatabases3() { $db1 = ["name" => "mydb", "other_info" => 42]; $db2 = ["name" => "myotherdb", "other_info" => 42]; $dbs = [$db1, $db2]; $this->assertSame($db2, LuticateApplication::getDatabase($db2["name"], $dbs)); } public function testGetDatabases4() { $db1 = ["name" => "mydb", "other_info" => 42]; $db2 = ["name" => "myotherdb", "other_info" => 42]; $dbs = [$db1, $db2]; $this->assertNull(LuticateApplication::getDatabase("anotherdb", $dbs)); } public function testResolveDatabases1() { $db1 = ["name" => "mydb", "other_info" => 42]; $dbs = [$db1, "mydb"]; $this->assertSame([$db1, $db1], LuticateApplication::resolveDatabases($dbs)); } public function testResolveDatabases2() { $db1 = ["name" => "mydb", "other_info" => 42]; $dbs = [$db1, "mydb2"]; $this->assertSame([$db1], LuticateApplication::resolveDatabases($dbs)); } public function testResolveDatabases3() { $db1 = ["name" => "mydb", "other_info" => 42]; $dbs = ["mydb2", $db1]; $this->assertSame([$db1], LuticateApplication::resolveDatabases($dbs)); } public function testResolveDatabases4() { $db1 = ["name" => "mydb", "other_info" => 42]; $dbs = ["mydb", $db1]; $this->assertSame([$db1, $db1], LuticateApplication::resolveDatabases($dbs)); } }