We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 1 |
Paths | 1 |
Total Lines | 30 |
Code Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function test_validate_config_happy_path() { |
||
16 | //# Given a Dotenv object |
||
17 | $dotEnv = $this->createMock(Dotenv::class); |
||
18 | // And the dotenv config will return the following array when loaded |
||
19 | $dotEnv |
||
20 | ->expects(self::once()) |
||
21 | ->method("load") |
||
22 | ->willReturn([ |
||
23 | "MYSQL_HOST" => "host", |
||
24 | "MYSQL_USER" => "user", |
||
25 | "MYSQL_PASSWORD" => "pass", |
||
26 | "MYSQL_DATABASE" => "database" |
||
27 | ]); |
||
28 | // And we expect that the dotenv "required" method will be called with the following arguments |
||
29 | $dotEnv |
||
30 | ->expects(self::exactly(4)) |
||
31 | ->method("required") |
||
32 | ->with( |
||
33 | $this->logicalOr( |
||
34 | "MYSQL_USER", |
||
35 | "MYSQL_HOST", |
||
36 | "MYSQL_PASSWORD", |
||
37 | "MYSQL_DATABASE")); |
||
38 | // When constructing the properties class |
||
39 | $mysqlProperties = new MySqlProperties($dotEnv); |
||
40 | // Then the properties have expected values |
||
41 | self::assertEquals("host", $mysqlProperties->getHost()); |
||
42 | self::assertEquals("user", $mysqlProperties->getUser()); |
||
43 | self::assertEquals("pass", $mysqlProperties->getPassword()); |
||
44 | self::assertEquals("database", $mysqlProperties->getDatabaseName()); |
||
45 | } |
||
47 |