forked from MyIntervals/PHP-CSS-Parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyframeSelectorTest.php
More file actions
52 lines (41 loc) · 1.27 KB
/
Copy pathKeyframeSelectorTest.php
File metadata and controls
52 lines (41 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
declare(strict_types=1);
namespace Sabberworm\CSS\Tests\Unit\Property;
use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Property\KeyframeSelector;
use Sabberworm\CSS\Property\Selector\CompoundSelector;
/**
* @covers \Sabberworm\CSS\Property\KeyframeSelector
* @covers \Sabberworm\CSS\Property\Selector
*/
final class KeyframeSelectorTest extends TestCase
{
/**
* @test
*/
public function getArrayRepresentationIncludesClassName(): void
{
$subject = new KeyframeSelector('50%');
$result = $subject->getArrayRepresentation();
self::assertSame('KeyframeSelector', $result['class']);
}
/**
* @test
*/
public function getArrayRepresentationIncludesComponent(): void
{
$subject = new KeyframeSelector([new CompoundSelector('50%')]);
$result = $subject->getArrayRepresentation();
self::assertSame('50%', $result['components'][0]['value']);
}
/**
* @test
*/
public function isValidThrowsForSelectorThatIsNotValidUtf8(): void
{
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('The selector is not valid UTF-8.');
$this->expectExceptionCode(1787284398);
KeyframeSelector::isValid("a\xFF");
}
}