Code Duplication    Length = 10-11 lines in 2 locations

Grafizzi/Graph/Tests/IG12913Test.php 2 locations

@@ 83-93 (lines=11) @@
80
   * @param FilterInterface $filter
81
   * @param string $format
82
   */
83
  protected function withDicException(FilterInterface $filter, $format) {
84
    $dic = new Container(array('use_exceptions' => true));
85
    $filter->setDic($dic);
86
    try {
87
      $filter->image($format);
88
      $this->fail('Invalid format image did not throw an exception.');
89
    }
90
    catch (\InvalidArgumentException $e) {
91
      $this->assertInstanceOf('InvalidArgumentException', $e, 'Invalid argument for invalid format.');
92
    }
93
  }
94
95
  /**
96
   * @param FilterInterface $filter
@@ 99-108 (lines=10) @@
96
   * @param FilterInterface $filter
97
   * @param string $format
98
   */
99
  protected function withDicNoException(FilterInterface $filter, $format) {
100
    $dic = new Container(array('use_exceptions' => false));
101
    $filter->setDic($dic);
102
    try {
103
      $result = $filter->image($format);
104
      $this->assertFalse($result, 'Unavailable format image.');
105
    }
106
    catch (\InvalidArgumentException $e) {
107
      $this->fail('Invalid format image threw an exception.');
108
    }  }
109
110
  /**
111
   * Tests Graph->image()