setLanguage(); $config = Config::getInstance(); $config->settings['DefaultTabDatabase'] = '/database/structure'; $config->settings['ServerDefault'] = 1; $relationParameters = RelationParameters::fromArray([ 'db' => 'pmadb', 'navwork' => true, 'navigationhiding' => 'navigationhiding', ]); (new ReflectionProperty(Relation::class, 'cache'))->setValue(null, $relationParameters); $this->object = $this->getMockBuilder(NodeDatabaseChild::class) ->setConstructorArgs([$config, 'child']) ->onlyMethods(['getItemType']) ->getMock(); } /** * Tears down the fixture. */ protected function tearDown(): void { parent::tearDown(); unset($this->object); } /** * Tests getHtmlForControlButtons() method */ public function testGetHtmlForControlButtons(): void { $relationParameters = RelationParameters::fromArray([ 'db' => 'pmadb', 'navwork' => true, 'navigationhiding' => 'navigationhiding', ]); $parent = new NodeDatabase(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, ); } }