Issues (8)

tests/GachaTest.php (1 issue)

Labels
Severity
1
<?php
2
//  ../vendor/bin/phpunit --bootstrap ../vendor/autoload.php tests/GachaTest.php
3
// Path to run ./vendor/bin/phpunit --bootstrap vendor/autoload.php FileName.php
4
// Butuh Framework PHPUnit
5
use PHPUnit\Framework\TestCase;
0 ignored issues
show
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Irfa\Gatcha\Roll;
7
8
// Class untuk run Testing.
9
class GachaTest extends TestCase
10
{
11
	public function testGachaItems()
12
	{
13
		$items = ['SSR ITEM' => 0.1,
14
					'SSR ITEM 2' => 0.2,
15
					'SSR ITEM 3' => 0.3,
16
					'SSR ITEM 4' => 0.4,
17
					'SR ITEM 1' => 0.5,
18
					'SR ITEM 2' => 0.6,
19
					'SR ITEM 3' => 1.2,
20
					'item 8' => 2,
21
					'item 9' => 2.8,
22
					'item 10' => 3.6,
23
					'item 11' => 4.4,
24
					'item 12' => 5.2,
25
					'item 13' => 6,
26
					'item 14' => 6.8,
27
					'item 15' => 7.6,
28
					'item 16' => 8.4,
29
					'item 17' => 9.2,
30
					'item 18' => 10,
31
					'item 19' => 10.8,
32
					'item 20' => 11.6,
33
					'item 21' => 8.3,
34
					];
35
		$this->assertArrayHasKey(Roll::put($items)->spin(),$items);
36
	}
37
	public function testGachaDropUpItems()
38
	{
39
		$items = ['SSR ITEM' => 0.1,
40
					'SSR ITEM 2' => 0.2,
41
					'SSR ITEM 3' => 0.3,
42
					'SSR ITEM 4' => 0.4,
43
					'SR ITEM 1' => 0.5,
44
					'SR ITEM 2' => 0.6,
45
					'SR ITEM 3' => 1.2,
46
					'item 8' => 2,
47
					'item 9' => 2.8,
48
					'item 10' => 3.6,
49
					'item 11' => 4.4,
50
					'item 12' => 5.2,
51
					'item 13' => 6,
52
					'item 14' => 6.8,
53
					'item 15' => 7.6,
54
					'item 16' => 8.4,
55
					'item 17' => 9.2,
56
					'item 18' => 10,
57
					'item 19' => 10.8,
58
					'item 20' => 11.6,
59
					'item 21' => 8.3,
60
					];
61
		$this->assertArrayHasKey(Roll::put($items)->dropUp('SSR ITEM',300)->spin(),$items);
62
	}
63
	public function testGachaJsonItems()
64
	{
65
		$items = ['SSR ITEM' => 0.1,
66
					'SSR ITEM 2' => 0.2,
67
					'SSR ITEM 3' => 0.3,
68
					'SSR ITEM 4' => 0.4,
69
					'SR ITEM 1' => 0.5,
70
					'SR ITEM 2' => 0.6,
71
					'SR ITEM 3' => 1.2,
72
					'item 8' => 2,
73
					'item 9' => 2.8,
74
					'item 10' => 3.6,
75
					'item 11' => 4.4,
76
					'item 12' => 5.2,
77
					'item 13' => 6,
78
					'item 14' => 6.8,
79
					'item 15' => 7.6,
80
					'item 16' => 8.4,
81
					'item 17' => 9.2,
82
					'item 18' => 10,
83
					'item 19' => 10.8,
84
					'item 20' => 11.6,
85
					'item 21' => 8.3,
86
					];
87
					$this->assertNotEquals(null,Roll::put($items)->dropUp('SSR ITEM',300)->jsonSpin());
88
	}
89
}