Passed
Push — main ( 40d4d0...b1f2dd )
by N.
05:04
created

SekvensAjaxTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 32
dl 0
loc 47
rs 10
c 0
b 0
f 0
wmc 1
1
<?php
2
3
/**
4
 * Klass SekvensAjaxTest.
5
 * Författare: Niklas Dougherty
6
 */
7
8
declare(strict_types=1);
9
10
namespace Tips\Tests\Ajax;
11
12
use PHPUnit\Framework\TestCase;
13
use Tips\Klasser\Spel;
14
use Tips\Ajax\SpelAjax;
15
use Tips\Ajax\SekvensAjax;
16
use Tips\Klasser\Utdelning;
17
use Tips\Klasser\Preludium;
18
use Tips\Klasser\Tips;
19
use Tips\Moduler\TT;
20
21
/**
22
 * Klass SekvensAjaxTest.
23
 */
24
class SekvensAjaxTest extends TestCase
25
{
26
	/**
27
	 * Construct object with argument and verify that the object has the expected properties.
28
	 */
29
	public function testSekvensAjax(): void
30
	{
31
		new Preludium();
32
33
		/**
34
		 * Preparera.
35
		 */
36
		$_REQUEST['ändra_speltyp'] = '1';
37
		new SpelAjax();
38
		unset($_REQUEST['ändra_speltyp']);
39
40
		$_REQUEST['ändra_omgång'] = '4905';
41
		new SpelAjax();
42
		unset($_REQUEST['ändra_omgång']);
43
44
		$_REQUEST['ny_sekvens'] = true;
45
		new SpelAjax();
46
		$spel = new Spel();
47
		$this->assertEquals($spel->sekvens, 2);
48
		unset($_REQUEST['ny_sekvens']);
49
50
		$_REQUEST['ändra_sekvens'] = '1';
51
		new SpelAjax();
52
		$spel = new Spel();
53
		$this->assertEquals($spel->sekvens, 1);
54
		unset($_REQUEST['ändra_sekvens']);
55
56
		$_REQUEST['ny_sekvens'] = 'sträng';
57
		new SpelAjax();
58
		$spel = new Spel();
59
		$this->assertEquals($spel->sekvens, 1);
60
		unset($_REQUEST['ny_sekvens']);
61
62
		$_REQUEST['radera_sekvens'] = '2';
63
		$_REQUEST['omgång'] = '4905';
64
		$_REQUEST['speltyp'] = '1';
65
		new SekvensAjax();
66
		$spel = new Spel();
67
		$this->assertEquals($spel->sekvens, 1);
68
		unset($_REQUEST['radera_sekvens']);
69
		unset($_REQUEST['omgång']);
70
		unset($_REQUEST['speltyp']);
71
	}
72
}
73