'some-class',
'label' => 'Some label',
'html-tooltip' => 'Some tooltip',
'label-class' => 'some-label-class',
'html-before-portal' => 'Some before portal',
'html-items' => 'Some items',
'html-after-portal' => 'Some after portal',
'array-list-items' => [ 'some-item-one', 'some-item-2', 'some-item-3' ]
]
]
];
}
/**
* @return array[]
*/
public function provideCountData(): array {
return [
[
[
'array-list-items' => [ 'some-item-one', 'some-item-2', 'some-item-3' ]
],
3
],
[
[
'html-items' => '
Some itemSome itemSome item'
],
3
]
];
}
/**
* This test checks if the CitizenComponentMenu class can be instantiated
* @covers ::__construct
*/
public function testConstruct() {
// Create a new CitizenComponentMenu object
$menu = new CitizenComponentMenu( [] );
// Check if the object is an instance of CitizenComponent
$this->assertInstanceOf( CitizenComponent::class, $menu );
}
/**
* This test checks if the count method returns the correct number of items
* @covers ::count
* @dataProvider provideCountData
*/
public function testCount( array $data, int $expected ) {
// Create a new CitizenComponentMenu object
$menu = new CitizenComponentMenu( $data );
// Check if the count method returns the correct number of items
$this->assertSame( $expected, $menu->count() );
}
/**
* This test checks if the getTemplateData method returns the correct data
* @covers ::getTemplateData
* @dataProvider provideMenuData
*/
public function testGetTemplateData( array $data ) {
// Create a new CitizenComponentMenu object
$menu = new CitizenComponentMenu( $data );
// Call the getTemplateData method
$actualData = $menu->getTemplateData();
// Check if the getTemplateData method returns the correct data
$this->assertSame( $data, $actualData );
}
}