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
Push — master ( a59d05...ae5583 )
by Dan
04:28
created

test_validate_config_happy_path()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 8
rs 10
1
<?php
2
3
namespace SmrTest\lib\DefaultGame;
4
5
use Dotenv\Dotenv;
6
use Dotenv\Exception\ValidationException;
7
use MySqlProperties;
8
use PHPUnit\Framework\TestCase;
9
10
/**
11
 * Class MySqlPropertiesTest
12
 * @package SmrTest\lib\DefaultGame
13
 * @covers MySqlProperties
14
 */
15
class MySqlPropertiesTest extends TestCase {
16
	private const RESOURCES = ROOT . "test/resources/mysql-config/validation";
17
18
	public function test_validate_config_happy_path() {
19
		// Given required environment file is present
20
		$config = Dotenv::createArrayBacked(self::RESOURCES, "good.env");
21
		$config->load();
22
		// When performing validation of the config
23
		MySqlProperties::validateConfig($config);
24
		// Then no errors are present.
25
		$this->assertTrue(true);
26
	}
27
28
	public function test_validate_config_missing_config_values_throws_exception() {
29
		try {
30
			// Given required environment file is present that is missing required fields
31
			$config = Dotenv::createArrayBacked(self::RESOURCES, "bad.env");
32
			$config->load();
33
			// When performing validation on the config
34
			MySqlProperties::validateConfig($config);
35
		} finally {
36
			// Then a validation exception is expected
37
			$this->expectException(ValidationException::class);
38
		}
39
	}
40
}
41