1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace App\Tests\Crossword\Features\Constructor\Scaner\Grid; |
6
|
|
|
|
7
|
|
|
use App\Crossword\Features\Constructor\Scanner\Grid\Cell; |
8
|
|
|
use App\Crossword\Features\Constructor\Scanner\Grid\Coordinate; |
9
|
|
|
use PHPUnit\Framework\TestCase; |
|
|
|
|
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* @coversDefaultClass \App\Crossword\Features\Constructor\Scanner\Grid\Cell |
13
|
|
|
*/ |
14
|
|
|
final class CellTest extends TestCase |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* @covers ::letter |
18
|
|
|
*/ |
19
|
|
|
public function testCellFillLetter(): void |
20
|
|
|
{ |
21
|
|
|
$cell = new Cell(new Coordinate(1, 1), null); |
|
|
|
|
22
|
|
|
self::assertNull($cell->letter()); |
23
|
|
|
|
24
|
|
|
$cell = Cell::withLetter($cell, 'a'); |
25
|
|
|
self::assertSame('a', $cell->letter()); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @covers ::isLetter |
30
|
|
|
*/ |
31
|
|
|
public function testCellIsLetter(): void |
32
|
|
|
{ |
33
|
|
|
$cell = new Cell(new Coordinate(1, 1), 'a'); |
34
|
|
|
|
35
|
|
|
self::assertTrue($cell->isLetter()); |
36
|
|
|
self::assertFalse($cell->isEmpty()); |
37
|
|
|
self::assertFalse($cell->isBlack()); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @covers ::isBlack |
42
|
|
|
*/ |
43
|
|
|
public function testCellIsBlack(): void |
44
|
|
|
{ |
45
|
|
|
$cell = new Cell(new Coordinate(1, 1), ''); |
46
|
|
|
|
47
|
|
|
self::assertTrue($cell->isBlack()); |
48
|
|
|
self::assertFalse($cell->isLetter()); |
49
|
|
|
self::assertFalse($cell->isEmpty()); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @covers ::isEmpty |
54
|
|
|
*/ |
55
|
|
|
public function testCellIsEmpty(): void |
56
|
|
|
{ |
57
|
|
|
$cell = new Cell(new Coordinate(1, 1), null); |
|
|
|
|
58
|
|
|
|
59
|
|
|
self::assertFalse($cell->isBlack()); |
60
|
|
|
self::assertFalse($cell->isLetter()); |
61
|
|
|
self::assertTrue($cell->isEmpty()); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @covers ::coordinate |
66
|
|
|
*/ |
67
|
|
|
public function testCoordinateIsJsonSerialized(): void |
68
|
|
|
{ |
69
|
|
|
$cell = new Cell(new Coordinate(1, 2), null); |
|
|
|
|
70
|
|
|
$coordinate = $cell->coordinate()->jsonSerialize(); |
71
|
|
|
|
72
|
|
|
self::assertInstanceOf(Coordinate::class, $cell->coordinate()); |
73
|
|
|
self::assertSame(1, $coordinate['x']); |
74
|
|
|
self::assertSame(2, $coordinate['y']); |
75
|
|
|
} |
76
|
|
|
} |
77
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths