Skip to content

Commit 1de46dc

Browse files
committed
Add test for constructor with Components
1 parent a624447 commit 1de46dc

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/Unit/Property/SelectorTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,22 @@ public static function provideComponentsAndArrayRepresentation(): array
383383
];
384384
}
385385

386+
/**
387+
* @test
388+
*
389+
* @param list<Component> $components
390+
* @param list<array{class: string, value: string}> $expectedRepresenation
391+
*
392+
* @dataProvider provideComponentsAndArrayRepresentation
393+
*/
394+
public function constructsWithComponentsProvided(array $components, array $expectedRepresenation): void
395+
{
396+
$subject = new Selector($components);
397+
398+
$representation = $subject->getArrayRepresentation()['components'];
399+
self::assertSame($expectedRepresenation, $representation);
400+
}
401+
386402
/**
387403
* @test
388404
*

0 commit comments

Comments
 (0)