Throw specific error if file is found to be empty
This commit is contained in:
@@ -6,6 +6,7 @@ namespace Pcm\IconBundle\Tests\Twig\Functions;
|
||||
|
||||
use Pcm\IconBundle\DependencyInjection\Configuration;
|
||||
use Pcm\IconBundle\Exception\ColourNotFound;
|
||||
use Pcm\IconBundle\Exception\EmptyFileException;
|
||||
use Pcm\IconBundle\Exception\IconNotFound;
|
||||
use Pcm\IconBundle\Twig\Runtime\IconRuntime;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
@@ -50,6 +51,12 @@ class IconRuntimeTest extends TestCase
|
||||
$this->icon->renderIcon(['icon' => random_bytes(8)]);
|
||||
}
|
||||
|
||||
public function testThrowsIfPassedInAnEmptyFile(): void
|
||||
{
|
||||
$this->expectException(EmptyFileException::class);
|
||||
$this->icon->renderIcon(['icon' => 'empty']);
|
||||
}
|
||||
|
||||
public function testNoTitleExistsIfNotPassedIn(): void
|
||||
{
|
||||
$content = $this->icon->renderIcon(['icon' => self::ICON]);
|
||||
|
||||
Reference in New Issue
Block a user