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

Failed Conditions
Push — main ( 5797ad...3faf69 )
by Dan
29s queued 24s
created

PageIntegrationTest::test_create_with_data()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 19
rs 9.9666
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace SmrTest\lib\DefaultGame;
4
5
use PHPUnit\Framework\TestCase;
6
use Smr\Container\DiContainer;
7
use Smr\Page\Page;
8
use Smr\Session;
9
10
/**
11
 * This is an integration test, but does not need to extend BaseIntegrationTest
12
 * since we are not (or should not be!) writing any data.
13
 *
14
 * @covers Smr\Page\Page
15
 */
16
class PageIntegrationTest extends TestCase {
17
18
	protected function setUp(): void {
19
		// Reset the DI container for each test to ensure independence.
20
		DiContainer::initialize(false);
21
	}
22
23
	public function test_href(): void {
24
		// Create an arbitrary Page
25
		$page = new Page();
26
27
		// Pre-initialize the Smr\Session, since it uses 'rand', and we don't
28
		// want it to interfere with our rand seed when we call `href`, which
29
		// internally requires an Smr\Session.
30
		Session::getInstance();
31
32
		// The Page should not be modified when href() is called
33
		$expected = clone $page;
34
		srand(0); // for a deterministic SN
35
		$href = $page->href();
36
		self::assertSame(LOADER_URI . '?sn=qpbqzr', $href);
37
		self::assertEquals($expected, $page);
38
	}
39
40
}
41