Test for palletes not existing
This commit is contained in:
@@ -4,13 +4,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace Pcm\IconBundle\Tests\Twig\Functions;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Pcm\IconBundle\DependencyInjection\PcmIconExtension;
|
||||
use Pcm\IconBundle\Tests\TestKernel;
|
||||
use Pcm\IconBundle\Twig\Functions\IconExtension;
|
||||
use Pcm\IconBundle\Twig\Functions\IconNotFound;
|
||||
use Pcm\IconBundle\Twig\Functions\PalleteNotFound;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use TypeError;
|
||||
|
||||
class IconExtensionTest extends TestCase
|
||||
{
|
||||
@@ -20,12 +17,7 @@ class IconExtensionTest extends TestCase
|
||||
'primary' => [
|
||||
'stroke' => 'stroke-primary',
|
||||
'fill' => 'fill-primary'
|
||||
],
|
||||
|
||||
'white' => [
|
||||
'stroke' => 'stroke-white',
|
||||
'fill' => 'fill-white'
|
||||
],
|
||||
]
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -212,4 +204,11 @@ class IconExtensionTest extends TestCase
|
||||
$this->assertDoesNotMatchRegularExpression('/fill="\s*#black\s*"/', $content);
|
||||
$this->assertDoesNotMatchRegularExpression('/fill="\s*rgb\(0,\s*0,\s*0\)\s*"/', $content);
|
||||
}
|
||||
|
||||
public function testThrowsIfPalleteIsNotFound(): void
|
||||
{
|
||||
$this->expectException(PalleteNotFound::class);
|
||||
$this->icon->renderIcon(['icon' => self::ICON, 'colour' => 'red']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user