|
@@ -45,8 +45,10 @@ class LuApplicationTest extends \PHPUnit_Framework_TestCase
|
45
|
45
|
public function testResolveDatabases1()
|
46
|
46
|
{
|
47
|
47
|
$db1 = ["name" => "mydb", "other_info" => 42];
|
48
|
|
- $dbs = [$db1, "mydb"];
|
49
|
|
- $this->assertSame([$db1, $db1], LuticateApplication::resolveDatabases($dbs));
|
|
48
|
+ $dbs = [$db1, ["name" => "mydb2", "alias" => "mydb"]];
|
|
49
|
+ $dbRes = $db1;
|
|
50
|
+ $dbRes["name"] = "mydb2";
|
|
51
|
+ $this->assertSame([$db1, $dbRes], LuticateApplication::resolveDatabases($dbs));
|
50
|
52
|
}
|
51
|
53
|
|
52
|
54
|
public function testResolveDatabases2()
|
|
@@ -59,15 +61,27 @@ class LuApplicationTest extends \PHPUnit_Framework_TestCase
|
59
|
61
|
public function testResolveDatabases3()
|
60
|
62
|
{
|
61
|
63
|
$db1 = ["name" => "mydb", "other_info" => 42];
|
62
|
|
- $dbs = ["mydb2", $db1];
|
|
64
|
+ $dbs = [["name" => "mydb2", "alias" => "mydb2"], $db1];
|
63
|
65
|
$this->assertSame([$db1], LuticateApplication::resolveDatabases($dbs));
|
64
|
66
|
}
|
65
|
67
|
|
66
|
68
|
public function testResolveDatabases4()
|
67
|
69
|
{
|
68
|
70
|
$db1 = ["name" => "mydb", "other_info" => 42];
|
69
|
|
- $dbs = ["mydb", $db1];
|
70
|
|
- $this->assertSame([$db1, $db1], LuticateApplication::resolveDatabases($dbs));
|
|
71
|
+ $dbs = [["name" => "mydb2", "alias" => "mydb"], $db1];
|
|
72
|
+ $dbRes = $db1;
|
|
73
|
+ $dbRes["name"] = "mydb2";
|
|
74
|
+ $this->assertSame([$dbRes, $db1], LuticateApplication::resolveDatabases($dbs));
|
|
75
|
+ }
|
|
76
|
+
|
|
77
|
+ public function testResolveDatabases5()
|
|
78
|
+ {
|
|
79
|
+ $db1 = ["name" => "mydb", "other_info" => 42, "other_info2" => 24];
|
|
80
|
+ $dbs = [["name" => "mydb2", "alias" => "mydb", "other_info2" => 42], $db1];
|
|
81
|
+ $dbRes = $db1;
|
|
82
|
+ $dbRes["name"] = "mydb2";
|
|
83
|
+ $dbRes["other_info2"] = 42;
|
|
84
|
+ $this->assertSame([$dbRes, $db1], LuticateApplication::resolveDatabases($dbs));
|
71
|
85
|
}
|
72
|
86
|
|
73
|
87
|
public function testSettings1()
|