settings['DefaultTabDatabase'] = 'structure'; $GLOBALS['server'] = 1; $config->settings['ServerDefault'] = 1; $relationParameters = RelationParameters::fromArray([ 'db' => 'pmadb', 'navwork' => true, 'navigationhiding' => 'navigationhiding', ]); (new ReflectionProperty(Relation::class, 'cache'))->setValue(null, $relationParameters); $this->object = $this->getMockForAbstractClass( NodeDatabaseChild::class, ['child'], ); } /** * 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('parent'); $parent->addChild($this->object); $this->object->expects($this->once()) ->method('getItemType') ->willReturn('itemType'); $html = $this->object->getHtmlForControlButtons($relationParameters->navigationItemsHidingFeature); $this->assertStringStartsWith('', $html); $this->assertStringEndsWith('', $html); $this->assertStringContainsString( '', $html, ); } }