'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 VectorComponentMenu class can be instantiated
* @covers ::__construct
*/
public function testConstruct() {
// Create a new VectorComponentMenu object
$menu = new VectorComponentMenu( [] );
// Check if the object is an instance of VectorComponent
$this->assertInstanceOf( VectorComponent::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 VectorComponentMenu object
$menu = new VectorComponentMenu( $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 VectorComponentMenu object
$menu = new VectorComponentMenu( $data );
// Call the getTemplateData method
$actualData = $menu->getTemplateData();
// Check if the getTemplateData method returns the correct data
$this->assertSame( $data, $actualData );
}
}