Skip to content

Commit

Permalink
Add a first test POC
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude committed Oct 1, 2024
1 parent e3a74bd commit aef2551
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions extra/html-extra/Tests/HtmlAttrMergeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Twig\Extra\Html\Tests;

use PHPUnit\Framework\TestCase;
use Twig\Extra\Html\HtmlExtension;

class HtmlAttrMergeTest extends TestCase
{
/**
* @dataProvider htmlAttrProvider
*/
public function testMerge(array $expected, array $inputs): void
{
$result = HtmlExtension::htmlAttrMerge(...$inputs);

self::assertSame($expected, $result);
}

public function htmlAttrProvider(): \Generator
{
yield 'simple test' => [
['id' => 'some-id', 'class' => ['some-class']],
[
['id' => 'some-id'],
['class' => 'some-class'],
]
];
}
}

0 comments on commit aef2551

Please sign in to comment.