assertSame( $name, $entry->getName() ); $this->assertSame( [], $entry->getCSSClasses() ); $this->assertSame( [ [ 'text' => $text, 'href' => $url, 'icon' => 'minerva-foo', 'data-event-name' => 'menu.foo' ] ], $entry->getComponents() ); } /** * @covers ::overrideCssClass * @covers ::overrideText * @covers ::getComponents */ public function testOverride() { $entry = new HomeMenuEntry( 'foo', 'bar', 'http://baz' ); $component = current( $entry->getComponents() ); $this->assertSame( 'bar', $component['text'] ); $this->assertSame( 'minerva-foo', $component['icon'] ); $entry->overrideText( 'blah' ) ->overrideCssClass( 'classy' ); $component = current( $entry->getComponents() ); $this->assertSame( 'blah', $component['text'] ); $this->assertSame( 'classy', $component['class'] ); } }