Code Duplication    Length = 30-35 lines in 2 locations

Grafizzi/Graph/Tests/IG18676Test.php 1 location

@@ 41-70 (lines=30) @@
38
 *
39
 * @link     http://pear.php.net/bugs/bug.php?id=18676
40
 */
41
class IG18676Test extends BaseGraphTest {
42
43
  public $expected = <<<EOT
44
strict digraph G {
45
  subgraph cluster_c1_id {
46
    label=c1_title;
47
  } /* /subgraph cluster_c1_id */
48
} /* /digraph G */
49
50
EOT;
51
52
  public function setUp() : void {
53
    parent::setUpExtended('G', array('strict' => true));
54
    $g = $this->Graph;
55
    $dic = $this->dic;
56
    $g->setDirected(true);
57
58
    $g->addChild($cluster = new Cluster($dic, 'c1_id', array(
59
      new Attribute($dic, 'label', 'c1_title'),
60
    )));
61
    $cluster->addChild(new Node($dic, 'n', array('implicit' => true)));
62
  }
63
64
  /**
65
   * Tests Graph->build()
66
   */
67
  public function testBuild() {
68
    $this->check($this->expected, "Image_GraphViz bug test 18676 passed.");
69
  }
70
}
71

Grafizzi/Graph/Tests/IG19286Test.php 1 location

@@ 41-75 (lines=35) @@
38
 *
39
 * @link     http://pear.php.net/bugs/bug.php?id=19286
40
 */
41
class IG19286Test extends BaseGraphTest {
42
43
  public $expected = <<<EOT
44
strict digraph G {
45
  subgraph cluster_c1_id {
46
    label=c1_title;
47
  } /* /subgraph cluster_c1_id */
48
  subgraph s1_id {
49
    label=s1_title;
50
  } /* /subgraph s1_id */
51
} /* /digraph G */
52
53
EOT;
54
55
  public function setUp() : void {
56
    parent::setUpExtended('G', array('strict' => true));
57
    $g = $this->Graph;
58
    $dic = $this->dic;
59
    $g->setDirected(true);
60
61
    $g->addChild($c1_id = new Cluster($dic, 'c1_id', array(
62
      new Attribute($dic, 'label', 'c1_title'),
63
    )));
64
    $g->addChild($s1_id = new Subgraph($dic, 's1_id', array(
65
      new Attribute($dic, 'label', 's1_title'),
66
    )));
67
  }
68
69
  /**
70
   * Tests Graph->build()
71
   */
72
  public function testBuild() {
73
    $this->check($this->expected, "Image_GraphViz bug test 19286 passed.");
74
  }
75
}
76