Skip to content

Commit aef2551

Browse files
committed
Add a first test POC
1 parent e3a74bd commit aef2551

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace Twig\Extra\Html\Tests;
4+
5+
use PHPUnit\Framework\TestCase;
6+
use Twig\Extra\Html\HtmlExtension;
7+
8+
class HtmlAttrMergeTest extends TestCase
9+
{
10+
/**
11+
* @dataProvider htmlAttrProvider
12+
*/
13+
public function testMerge(array $expected, array $inputs): void
14+
{
15+
$result = HtmlExtension::htmlAttrMerge(...$inputs);
16+
17+
self::assertSame($expected, $result);
18+
}
19+
20+
public function htmlAttrProvider(): \Generator
21+
{
22+
yield 'simple test' => [
23+
['id' => 'some-id', 'class' => ['some-class']],
24+
[
25+
['id' => 'some-id'],
26+
['class' => 'some-class'],
27+
]
28+
];
29+
}
30+
}

0 commit comments

Comments
 (0)