Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/Unit/CSSList/AtRuleBlockListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,16 @@ public function isRootListAlwaysReturnsFalse(): void

self::assertFalse($subject->isRootList());
}

/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new AtRuleBlockList('media');

$subject->getArrayRepresentation();
}
}
12 changes: 12 additions & 0 deletions tests/Unit/CSSList/CSSBlockListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,4 +471,16 @@ public function getAllValuesWithSearchInFunctionArgumentsReturnsValuesInFunction

self::assertSame([$value1, $value2], $result);
}

/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new ConcreteCSSBlockList();

$subject->getArrayRepresentation();
}
}
12 changes: 12 additions & 0 deletions tests/Unit/CSSList/DocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,16 @@ public function isRootListAlwaysReturnsTrue(): void

self::assertTrue($subject->isRootList());
}

/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new Document();

$subject->getArrayRepresentation();
}
}
12 changes: 12 additions & 0 deletions tests/Unit/CSSList/KeyFrameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,16 @@ public function getVendorKeyFrameByDefaultReturnsKeyframes(): void

self::assertSame('keyframes', $subject->getVendorKeyFrame());
}

/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new KeyFrame();

$subject->getArrayRepresentation();
}
}
27 changes: 27 additions & 0 deletions tests/Unit/Property/KeyframeSelectorTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests\Unit\Property;

use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Property\KeyframeSelector;

/**
* @covers \Sabberworm\CSS\Property\KeyframeSelector
* @covers \Sabberworm\CSS\Property\Selector
*/
final class KeyframeSelectorTest extends TestCase
{
/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new KeyframeSelector('a');

$subject->getArrayRepresentation();
}
}
10 changes: 10 additions & 0 deletions tests/Unit/RuleSet/AtRuleSetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,14 @@ public function implementsCSSListItem(): void
{
self::assertInstanceOf(CSSListItem::class, $this->subject);
}

/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$this->subject->getArrayRepresentation();
}
}
28 changes: 28 additions & 0 deletions tests/Unit/Value/CSSFunctionTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests\Unit\Value;

use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Value\CSSFunction;

/**
* @covers \Sabberworm\CSS\Value\CSSFunction
* @covers \Sabberworm\CSS\Value\Value
* @covers \Sabberworm\CSS\Value\ValueList
*/
final class CSSFunctionTest extends TestCase
{
/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new CSSFunction('filter', []);

$subject->getArrayRepresentation();
}
}
12 changes: 12 additions & 0 deletions tests/Unit/Value/CSSStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,16 @@ public function getLineNumberReturnsLineNumberProvidedToConstructor(): void

self::assertSame($lineNumber, $subject->getLineNumber());
}

/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new CSSString('');

$subject->getArrayRepresentation();
}
}
12 changes: 12 additions & 0 deletions tests/Unit/Value/CalcFunctionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,16 @@ private function parse(string $css): CalcFunction
self::assertInstanceOf(CalcFunction::class, $function);
return $function;
}

/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new CalcFunction('calc', []);

$subject->getArrayRepresentation();
}
}
12 changes: 12 additions & 0 deletions tests/Unit/Value/CalcRuleValueListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,16 @@ public function separatorAlwaysIsComma(): void

self::assertSame(',', $subject->getListSeparator());
}

/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new CalcRuleValueList();

$subject->getArrayRepresentation();
}
}
12 changes: 12 additions & 0 deletions tests/Unit/Value/ColorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,4 +471,16 @@ public function throwsExceptionWithInvalidColor(string $color): void

Color::parse(new ParserState($color, Settings::create()));
}

/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new Color([]);

$subject->getArrayRepresentation();
}
}
28 changes: 28 additions & 0 deletions tests/Unit/Value/LineNameTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests\Unit\Value;

use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Value\LineName;

/**
* @covers \Sabberworm\CSS\Value\LineName
* @covers \Sabberworm\CSS\Value\Value
* @covers \Sabberworm\CSS\Value\ValueList
*/
final class LineNameTest extends TestCase
{
/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new LineName();

$subject->getArrayRepresentation();
}
}
28 changes: 28 additions & 0 deletions tests/Unit/Value/RuleValueListTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests\Unit\Value;

use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Value\RuleValueList;

/**
* @covers \Sabberworm\CSS\Value\RuleValueList
* @covers \Sabberworm\CSS\Value\Value
* @covers \Sabberworm\CSS\Value\ValueList
*/
final class RuleValueListTest extends TestCase
{
/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new RuleValueList();

$subject->getArrayRepresentation();
}
}
12 changes: 12 additions & 0 deletions tests/Unit/Value/SizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,16 @@ public function parsesUnit(string $unit): void

self::assertSame($unit, $parsedSize->getUnit());
}

/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new Size(1);

$subject->getArrayRepresentation();
}
}
12 changes: 12 additions & 0 deletions tests/Unit/Value/URLTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,16 @@ public function getLineNumberReturnsLineNumberProvidedToConstructor(): void

self::assertSame($lineNumber, $subject->getLineNumber());
}

/**
* @test
*/
public function getArrayRepresentationThrowsException(): void
{
$this->expectException(\BadMethodCallException::class);

$subject = new URL(new CSSString('http://example.com'));

$subject->getArrayRepresentation();
}
}