Example #1
0
 /**
  * Adds a subgraph to this graph; automatically changes the type to subgraph.
  *
  * Please note that an index is maintained using the name of the subgraph.
  * Thus if you have 2 subgraphs with the same name that the first will be
  * overwritten by the latter.
  *
  * @param \phpDocumentor\GraphViz\Graph $graph The graph to add onto this graph as
  *  subgraph.
  *
  * @see \phpDocumentor\GraphViz\Graph::create()
  *
  * @return \phpDocumentor\GraphViz\Graph
  */
 public function addGraph(\phpDocumentor\GraphViz\Graph $graph)
 {
     $graph->setType('subgraph');
     $this->graphs[$graph->getName()] = $graph;
     return $this;
 }
Example #2
0
 /**
  * @covers phpDocumentor\GraphViz\Graph::getName
  */
 public function testGetName()
 {
     $this->assertSame($this->fixture->getName(), 'G', 'Expecting the name to match the initial state');
     $this->fixture->setName('otherName');
     $this->assertSame($this->fixture->getName(), 'otherName', 'Expecting the name to contain the new value');
 }