Skip to content

Commit

Permalink
Tests: added test for InlineSvgIcons
Browse files Browse the repository at this point in the history
  • Loading branch information
janpecha committed Dec 19, 2023
1 parent ddc9487 commit 34e326d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/Icons/InlineSvgIcons.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

use Inteve\Icons;
use Tester\Assert;

require __DIR__ . '/../bootstrap.php';

define('TEMP_DIR', prepareTempDir());

test('default', function () {
file_put_contents(TEMP_DIR . '/super_icon-x.svg', '<?xml version = "1.0" encoding = "UTF-8" standalone = "no" ?>
<svg version="1.1" width="200" height="200" viewBox="-100 -100 200 200" xmlns="http://www.w3.org/2000/svg" id="super_icon" style="width:10px">
<circle cx="0" cy="20" r="70" fill="#D1495B" />
</svg>');

$icons = new Icons\InlineSvgIcons(TEMP_DIR);

Assert::same('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-100 -100 200 200"><circle cx="0" cy="20" r="70" fill="#D1495B"/></svg>', (string) $icons->get('super_icon-x'));
});

0 comments on commit 34e326d

Please sign in to comment.