BaseTestsSuite   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 52
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addTestSuite() 0 3 1
A __construct() 0 30 3
A suite() 0 3 1
1
<?php
2
3
/**
4
 * @file
5
 * Grafizzi\Graph\Tests\BaseTestSuite: a component of the Grafizzi library.
6
 *
7
 * (c) 2012 Frédéric G. MARAND <[email protected]>
8
 *
9
 * Grafizzi is free software: you can redistribute it and/or modify it under the
10
 * terms of the GNU Lesser General Public License as published by the Free
11
 * Software Foundation, either version 3 of the License, or (at your option) any
12
 * later version.
13
 *
14
 * Grafizzi is distributed in the hope that it will be useful, but WITHOUT ANY
15
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16
 * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
17
 * details.
18
 *
19
 * You should have received a copy of the GNU Lesser General Public License
20
 * along with Grafizzi, in the COPYING.LESSER.txt file.  If not, see
21
 * <http://www.gnu.org/licenses/>
22
 */
23
24
25
namespace Grafizzi\Graph\Tests;
26
27
require 'vendor/autoload.php';
28
29
/**
30
 * Static test suite.
31
 */
32
class BaseTestsSuite extends \PHPUnit_Framework_TestSuite {
33
34
  /**
35
   * Extend PHPUnit addTestSuite to add test classes from the current namespace.
36
   *
37
   * @see PHPUnit_Framework_TestSuite::addTestSuite()
38
   */
39
  public function addTestSuite($testClass) {
40
    parent::addTestSuite(__NAMESPACE__ . "\\$testClass");
41
  }
42
43
  /**
44
   * Constructs the test suite handler.
45
   */
46
  public function __construct() {
47
    $this->setName('BaseTestsSuite');
48
49
    // Original unit tests for Grafizzi.
50
    $unitTests = array(
51
      'Attribute', 'Cluster', 'Edge',     'Graph',
52
      'MultiEdge', 'Node',    'Subgraph', 'escape',
53
      'Renderer',
54
      'SinkFilter', 'StringFilter',
55
    );
56
    foreach ($unitTests as $unit) {
57
      $this->addTestSuite("{$unit}Test");
58
    }
59
60
    // Image_GraphViz tests adapted for Grafizzi.
61
    // Note: Image_GraphViz tests skip many numbers between 7 and 20.
62
    $igTests = array(
63
      // Base tests
64
      '01', '02', '03', '04', '05', '06', '09',
65
      '12', '14', '16', '17', '19', '20', '20b',
66
      // Bug fix tests
67
      '15019', '15943', '16872', '18676', '19286',
68
      // Feature request tests
69
      '12913',
70
    );
71
72
    foreach ($igTests as $igTest) {
73
      $this->addTestSuite("IG{$igTest}Test");
74
    }
75
  }
76
77
  /**
78
   * Creates the suite.
79
   */
80
  public static function suite() {
81
    return new self();
82
  }
83
}
84