Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — master (#924)
by Dan
04:13
created

MySqlPropertiesTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 24
c 0
b 0
f 0
dl 0
loc 31
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_validate_config_happy_path() 0 30 1
1
<?php
2
3
namespace SmrTest;
4
5
use Dotenv\Dotenv;
6
use PHPUnit\Framework\TestCase;
7
use Smr\MySqlProperties;
8
9
/**
10
 * Class MySqlPropertiesTest
11
 * @package SmrTest\lib\DefaultGame
12
 * @covers \Smr\MySqlProperties
13
 */
14
class MySqlPropertiesTest extends TestCase {
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
	}
46
}
47