setLanguage(); $config = Config::getInstance(); $relationParameters = RelationParameters::fromArray([ RelationParameters::DATABASE => 'pmadb', RelationParameters::NAV_WORK => true, RelationParameters::NAVIGATION_HIDING => 'navigationhiding', ]); (new ReflectionProperty(Relation::class, 'cache'))->setValue(null, $relationParameters); $this->object = $this->getMockBuilder(NodeDatabaseChild::class) ->setConstructorArgs([$this->createDatabaseInterface(), $config, 'child']) ->onlyMethods(['getItemType']) ->getMock(); } /** * Tests getHtmlForControlButtons() method */ public function testGetHtmlForControlButtons(): void { $relationParameters = RelationParameters::fromArray([ RelationParameters::DATABASE => 'pmadb', RelationParameters::NAV_WORK => true, RelationParameters::NAVIGATION_HIDING => 'navigationhiding', ]); $parent = new NodeDatabase($this->createDatabaseInterface(), Config::getInstance(), 'parent'); $parent->addChild($this->object); $this->object->expects(self::once()) ->method('getItemType') ->willReturn('itemType'); $html = $this->object->getHtmlForControlButtons($relationParameters->navigationItemsHidingFeature); self::assertStringStartsWith('', $html); self::assertStringEndsWith('', $html); self::assertStringContainsString( '', $html, ); } }