5 * Copyright (c) 2002-2009, Sebastian Bergmann <sb@sebastian-bergmann.de>.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
15 * * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
20 * * Neither the name of Sebastian Bergmann nor the names of his
21 * contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
39 * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
40 * @copyright 2002-2009 Sebastian Bergmann <sb@sebastian-bergmann.de>
41 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
43 * @link http://www.phpunit.de/
44 * @since File available since Release 3.3.0
47 require_once 'PHPUnit/Framework/TestCase.php';
49 require_once 'PHPUnit/Util/Configuration.php';
56 * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
57 * @copyright 2002-2009 Sebastian Bergmann <sb@sebastian-bergmann.de>
58 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
59 * @version Release: 3.3.17
60 * @link http://www.phpunit.de/
61 * @since Class available since Release 3.3.0
63 class Util_ConfigurationTest extends PHPUnit_Framework_TestCase
65 protected $configuration;
67 protected function setUp()
69 $this->configuration = new PHPUnit_Util_Configuration(
70 dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.xml'
74 public function testGetFilterConfiguration()
86 'path' => '/path/to/files',
101 'path' => '/path/to/files',
107 0 => '/path/to/file',
113 'addUncoveredFilesFromWhitelist' => TRUE,
120 'path' => '/path/to/files',
126 0 => '/path/to/file',
135 'path' => '/path/to/files',
141 0 => '/path/to/file',
146 $this->configuration->getFilterConfiguration()
150 public function testGetGroupConfiguration()
163 $this->configuration->getGroupConfiguration()
167 public function testGetLoggingConfiguration()
171 'charset' => 'UTF-8',
172 'lowUpperBound' => '35',
173 'highLowerBound' => '70',
175 'highlight' => FALSE,
176 'coverage-html' => '/tmp/report',
177 'coverage-clover' => '/tmp/clover.xml',
178 'coverage-source' => '/tmp/coverage',
179 'graphviz' => '/tmp/logfile.dot',
180 'json' => '/tmp/logfile.json',
181 'metrics-xml' => '/tmp/metrics.xml',
182 'plain' => '/tmp/logfile.txt',
183 'cpdMinLines' => '5',
184 'cpdMinMatches' => '70',
185 'pmd-xml' => '/tmp/pmd.xml',
186 'tap' => '/tmp/logfile.tap',
187 'logIncompleteSkipped' => FALSE,
188 'test-xml' => '/tmp/logfile.xml',
189 'story-html' => '/tmp/story.html',
190 'story-text' => '/tmp/story.txt',
191 'testdox-html' => '/tmp/testdox.html',
192 'testdox-text' => '/tmp/testdox.txt',
194 $this->configuration->getLoggingConfiguration()
198 public function testGetPHPConfiguration()
211 $this->configuration->getPHPConfiguration()
215 public function testGetPHPUnitConfiguration()
219 'bootstrap' => '/path/to/bootstrap.php',
221 'convertErrorsToExceptions' => TRUE,
222 'convertNoticesToExceptions' => TRUE,
223 'convertWarningsToExceptions' => TRUE,
224 'stopOnFailure' => FALSE,
226 $this->configuration->getPHPUnitConfiguration()
230 public function testGetPMDConfiguration()
234 'PHPUnit_Util_Log_PMD_Rule_Project_CRAP' =>
243 'PHPUnit_Util_Log_PMD_Rule_Class_DepthOfInheritanceTree' =>
248 'PHPUnit_Util_Log_PMD_Rule_Class_EfferentCoupling' =>
253 'PHPUnit_Util_Log_PMD_Rule_Class_ExcessiveClassLength' =>
255 'threshold' => '1000',
258 'PHPUnit_Util_Log_PMD_Rule_Class_ExcessivePublicCount' =>
263 'PHPUnit_Util_Log_PMD_Rule_Class_TooManyFields' =>
268 'PHPUnit_Util_Log_PMD_Rule_Function_CodeCoverage' =>
277 'PHPUnit_Util_Log_PMD_Rule_Function_CRAP' =>
282 'PHPUnit_Util_Log_PMD_Rule_Function_CyclomaticComplexity' =>
287 'PHPUnit_Util_Log_PMD_Rule_Function_ExcessiveMethodLength' =>
289 'threshold' => '100',
292 'PHPUnit_Util_Log_PMD_Rule_Function_ExcessiveParameterList' =>
297 'PHPUnit_Util_Log_PMD_Rule_Function_NPathComplexity' =>
299 'threshold' => '200',
303 $this->configuration->getPMDConfiguration()
307 public function testGetSeleniumBrowserConfiguration()
313 'name' => 'Firefox on Linux',
314 'browser' => '*firefox /usr/lib/firefox/firefox-bin',
315 'host' => 'my.linux.box',
320 $this->configuration->getSeleniumBrowserConfiguration()