|
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
|
|
|
/** |
|
10
|
|
|
* Test cases for class Guess. |
|
11
|
|
|
*/ |
|
12
|
|
|
class PokerSquaresCreateObjectTest extends TestCase |
|
13
|
|
|
{ |
|
14
|
|
|
// /** |
|
15
|
|
|
// * Construct object and verify that the object is instance of class |
|
16
|
|
|
// */ |
|
17
|
|
|
public function testCreateObjectPokerSquares() |
|
18
|
|
|
{ |
|
19
|
|
|
$pokersquares = new PokerSquares(); |
|
20
|
|
|
$this->assertInstanceOf("\Joki20\Http\Controllers\PokerSquares", $pokersquares); |
|
21
|
|
|
} |
|
22
|
|
|
|
|
23
|
|
|
// /** |
|
24
|
|
|
// * Test empty $_POST array |
|
25
|
|
|
// */ |
|
26
|
|
|
public function testEmptyPost() |
|
27
|
|
|
{ |
|
28
|
|
|
$pokersquares = new PokerSquares(); |
|
29
|
|
|
$this->assertInstanceOf("\Joki20\Http\Controllers\PokerSquares", $pokersquares); |
|
30
|
|
|
|
|
31
|
|
|
$exp = $pokersquares->game(); |
|
|
|
|
|
|
32
|
|
|
$this->assertEquals($exp, null); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
public function testTraitDeckName() |
|
36
|
|
|
{ |
|
37
|
|
|
$pokersquares = new PokerSquares(); |
|
38
|
|
|
|
|
39
|
|
|
$exp = strlen($pokersquares->name()); |
|
40
|
|
|
$this->assertEquals($exp, 265); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
View Code Duplication |
public function testTraitDeckDeckSize() |
|
|
|
|
|
|
44
|
|
|
{ |
|
45
|
|
|
$pokersquares = new PokerSquares(); |
|
46
|
|
|
|
|
47
|
|
|
$exp = $pokersquares->deckSize(['<div class="card rank08C">8 <br/> ♣</div>','<div class="card rank09C">9 <br/> ♣</div>',]); |
|
48
|
|
|
$this->assertEquals($exp, 2); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
public function testTraitSetupName() |
|
52
|
|
|
{ |
|
53
|
|
|
$pokersquares = new PokerSquares(); |
|
54
|
|
|
|
|
55
|
|
|
$exp = strlen($pokersquares->name()); |
|
56
|
|
|
$this->assertEquals($exp, 265); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
// public function testTraitSetupShuffleDeck() |
|
60
|
|
|
// { |
|
61
|
|
|
// $pokersquares = new PokerSquares(); |
|
62
|
|
|
// |
|
63
|
|
|
// $pokersquares->shuffleDeck(); |
|
64
|
|
|
|
|
65
|
|
|
// $exp = 52; |
|
66
|
|
|
// $res = count(session('deck')); |
|
67
|
|
|
// |
|
68
|
|
|
// $this->assertEquals($exp, 52); |
|
69
|
|
|
// |
|
70
|
|
|
// } |
|
71
|
|
|
|
|
72
|
|
|
} |
|
73
|
|
|
|
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.