/** * @covers phpDocumentor\GraphViz\Graph::getGraph */ public function testGetGraph() { $mock = $this->getMock('phpDocumentor\\GraphViz\\Graph'); $mock->expects($this->any())->method('getName')->will($this->returnValue('MyName')); $this->fixture->addGraph($mock); $this->assertSame($mock, $this->fixture->getGraph('MyName')); }
/** * @param string $name * * @return \phpDocumentor\GraphViz\Graph */ private function getGraphByName($name) { $name = 'cluster_' . $name; if (!$this->graph->hasGraph($name)) { $graph = $this->graph->create($name); $this->graph->addGraph($graph); } return $this->graph->getGraph($name); }