createMock( Skin::class ); $htmlData = []; $headingOptions = []; $classes = ''; // Create a new VectorComponentMainMenuAction object $mainMenuAction = new VectorComponentMainMenuAction( 'actionName', $skinMock, $htmlData, $headingOptions, $classes ); // Check if the object is an instance of VectorComponent $this->assertInstanceOf( VectorComponent::class, $mainMenuAction ); } /** * This test checks if the makeMainMenuActionData method returns the correct data * @covers ::getTemplateData */ public function testMakeMainMenuActionData() { // Mock the Skin $skinMock = $this->createMock( Skin::class ); // Create a new VectorComponentMainMenuAction object $mainMenuAction = new VectorComponentMainMenuAction( 'action-example', $skinMock, [ 'html-content' => 'Some Link' ], [ 'heading' => 'Some Heading' ], 'some-class' ); // Call the getTemplateData method $templateData = $mainMenuAction->getTemplateData(); // Verifying that the template data is constructed as expected $this->assertEquals( 'Some Heading', $templateData['heading'] ); $this->assertStringContainsString( 'Some Link', $templateData['html-content'] ); $this->assertEquals( 'some-class', $templateData['class'] ); } }