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
Pull Request — main (#1494)
by Dan
08:06 queued 03:15
created

PageIntegrationTest::test_skipRedirect()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
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 10
rs 10
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