|
7 | 7 | use PHPUnit\Framework\TestCase;
|
8 | 8 | use Sabberworm\CSS\Parsing\ParserState;
|
9 | 9 | use Sabberworm\CSS\Settings;
|
| 10 | +use Sabberworm\CSS\Value\PrimitiveValue; |
10 | 11 | use Sabberworm\CSS\Value\Size;
|
| 12 | +use Sabberworm\CSS\Value\Value; |
11 | 13 |
|
12 | 14 | /**
|
| 15 | + * @covers \Sabberworm\CSS\Value\PrimitiveValue |
13 | 16 | * @covers \Sabberworm\CSS\Value\Size
|
| 17 | + * @covers \Sabberworm\CSS\Value\Value |
14 | 18 | */
|
15 | 19 | final class SizeTest extends TestCase
|
16 | 20 | {
|
17 | 21 | /**
|
18 |
| - * @return array<string, array{0: string}> |
| 22 | + * @test |
| 23 | + */ |
| 24 | + public function isPrimitiveValue(): void |
| 25 | + { |
| 26 | + $subject = new Size(1); |
| 27 | + |
| 28 | + self::assertInstanceOf(PrimitiveValue::class, $subject); |
| 29 | + } |
| 30 | + |
| 31 | + /** |
| 32 | + * @test |
| 33 | + */ |
| 34 | + public function isValue(): void |
| 35 | + { |
| 36 | + $subject = new Size(1); |
| 37 | + |
| 38 | + self::assertInstanceOf(Value::class, $subject); |
| 39 | + } |
| 40 | + |
| 41 | + /** |
| 42 | + * @return array<string, array{0: non-empty-string}> |
19 | 43 | */
|
20 | 44 | public static function provideUnit(): array
|
21 | 45 | {
|
@@ -64,12 +88,14 @@ static function (string $unit): array {
|
64 | 88 | /**
|
65 | 89 | * @test
|
66 | 90 | *
|
| 91 | + * @param non-empty-string $unit |
| 92 | + * |
67 | 93 | * @dataProvider provideUnit
|
68 | 94 | */
|
69 | 95 | public function parsesUnit(string $unit): void
|
70 | 96 | {
|
71 |
| - $subject = Size::parse(new ParserState('1' . $unit, Settings::create())); |
| 97 | + $parsedSize = Size::parse(new ParserState('1' . $unit, Settings::create())); |
72 | 98 |
|
73 |
| - self::assertSame($unit, $subject->getUnit()); |
| 99 | + self::assertSame($unit, $parsedSize->getUnit()); |
74 | 100 | }
|
75 | 101 | }
|
0 commit comments