|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
// php artisan test |
|
4
|
|
|
namespace Tests\Unit; |
|
5
|
|
|
|
|
6
|
|
|
use PHPUnit\Framework\TestCase; |
|
7
|
|
|
use Joki20\Http\Controllers\PokerSquares; |
|
8
|
|
|
use Joki20\Http\Controllers\Setup; |
|
9
|
|
|
use Joki20\Http\Controllers\Scoring; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* Test cases for trait Scoring. |
|
13
|
|
|
*/ |
|
14
|
|
|
class ScoringTraitTest extends TestCase |
|
15
|
|
|
{ |
|
16
|
|
|
// /** |
|
17
|
|
|
// * Construct object and verify that the object is instance of class |
|
18
|
|
|
// */ |
|
19
|
|
|
public function testCreateObjectPokerSquares() |
|
20
|
|
|
{ |
|
21
|
|
|
$pokersquares = new PokerSquares(); |
|
22
|
|
|
$this->assertInstanceOf("\Joki20\Http\Controllers\PokerSquares", $pokersquares); |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
public function testCheckFullRow() |
|
26
|
|
|
{ |
|
27
|
|
|
$pokersquares = new PokerSquares(); |
|
28
|
|
|
// session('dataRow00', [[H,D,C,S,D],[03,05,01,13,10]]) |
|
29
|
|
|
session()->put('dataRow01', [['h','c','d','s','c'], [2,5,6,3,1]]); |
|
30
|
|
|
$exp = [1,2,3,5,6]; |
|
31
|
|
|
$res = $pokersquares->sortHand('Row01'); |
|
32
|
|
|
$this->assertEquals($exp, $res); |
|
33
|
|
|
// $this->currentSession = 234; |
|
34
|
|
|
// $pokersquares->checkFullRow(); |
|
35
|
|
|
// |
|
36
|
|
|
// var_dump($this->suitsRow); |
|
37
|
|
|
} |
|
38
|
|
|
} |
|
39
|
|
|
|