@@ 34-51 (lines=18) @@ | ||
31 | * @group Helpers |
|
32 | * @group MatchSimulator |
|
33 | */ |
|
34 | public function testMatchSimulator() |
|
35 | { |
|
36 | $match = \App\Lib\DsManager\Models\Orm\Match::where( |
|
37 | [ |
|
38 | 'simulated' => false |
|
39 | ] |
|
40 | )->get()->random(1); |
|
41 | $this->assertNotEmpty($match); |
|
42 | $result = \App\Lib\DsManager\Helpers\MatchSimulator::simulate($match->id); |
|
43 | $this->assertNotEmpty($result); |
|
44 | $match = \App\Lib\DsManager\Models\Orm\Match::where( |
|
45 | [ |
|
46 | 'id' => $match->id, |
|
47 | 'simulated' => true |
|
48 | ] |
|
49 | )->first(); |
|
50 | $this->assertNotEmpty($match); |
|
51 | } |
|
52 | ||
53 | /** |
|
54 | * @group Helpers |
|
@@ 57-76 (lines=20) @@ | ||
54 | * @group Helpers |
|
55 | * @group RoundSimulator |
|
56 | */ |
|
57 | public function testRoundSimulator() |
|
58 | { |
|
59 | $match = \App\Lib\DsManager\Models\Orm\Match::where( |
|
60 | [ |
|
61 | 'simulated' => false |
|
62 | ] |
|
63 | )->whereNotNull( |
|
64 | 'league_round_id' |
|
65 | )->get()->random(1); |
|
66 | $this->assertNotEmpty($match); |
|
67 | $result = \App\Lib\DsManager\Helpers\MatchSimulator::simulateRound($match->league_round_id); |
|
68 | $this->assertNotEmpty($result); |
|
69 | $match = \App\Lib\DsManager\Models\Orm\Match::where( |
|
70 | [ |
|
71 | 'id' => $match->id, |
|
72 | 'simulated' => true |
|
73 | ] |
|
74 | )->first(); |
|
75 | $this->assertNotEmpty($match); |
|
76 | } |
|
77 | ||
78 | } |
|
79 |