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 (#1034)
by Dan
04:53
created

SmrSessionIntegrationTest::test_game()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 10
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace SmrTest\lib\DefaultGame;
4
5
use SmrSession;
6
use SmrTest\BaseIntegrationSpec;
7
8
/**
9
 * @covers SmrSession
10
 */
11
class SmrSessionIntegrationTest extends BaseIntegrationSpec {
12
13
	private SmrSession $session;
14
15
	protected function setUp() : void {
16
		// Start each test with a fresh container (and SmrSession).
17
		// This ensures the independence of each test.
18
		\Smr\Container\DiContainer::initializeContainer();
19
		$this->session = SmrSession::getInstance();
20
	}
21
22
	public function test_game() {
23
		// Sessions are initialized with no game
24
		self::assertFalse($this->session->hasGame());
25
		self::assertSame(0, $this->session->getGameID());
26
27
		// Now update the game
28
		$gameID = 3;
29
		$this->session->updateGame($gameID);
30
		self::assertTrue($this->session->hasGame());
31
		self::assertSame($gameID, $this->session->getGameID());
32
	}
33
34
	public function test_account() {
35
		// Sessions are initialized with no account
36
		self::assertFalse($this->session->hasAccount());
37
		self::assertSame(0, $this->session->getAccountID());
38
39
		// Now update the account
40
		$account = $this->createMock(\AbstractSmrAccount::class);
41
		$account
42
			->method('getAccountID')
43
			->willReturn(7);
44
		$this->session->setAccount($account);
45
		self::assertTrue($this->session->hasAccount());
46
		self::assertSame(7, $this->session->getAccountID());
47
	}
48
49
}
50