History
Version 186
at Wednesday 24 February 2010 11:11:18 UTC - Fixed #7: Incorrectly detected unused vars and params are now ok.Diff
| 185 | 186 | /test/PHP/PMD/Regression/AllTests.php |
|---|---|---|
| 50 | 50 | require_once 'PHPUnit/Framework.php'; |
| 51 | 51 | |
| 52 | 52 | require_once dirname(__FILE__) . '/AcceptsFilesAndDirectoriesAsInputTicket001Test.php'; |
| 53 | +require_once dirname(__FILE__) . '/InvalidUnusedLocalVariableAndFormalParameterTicket007Test.php'; | |
| 53 | 54 | |
| 54 | 55 | /** |
| 55 | 56 | * Main test suite for the PHP_PMD_Regression package. |
| 75 | 76 | $suite = new PHPUnit_Framework_TestSuite('PHP_PMD_Regression - Tests'); |
| 76 | 77 | |
| 77 | 78 | $suite->addTestSuite('PHP_PMD_Regression_AcceptsFilesAndDirectoriesAsInputTicket001Test'); |
| 79 | + $suite->addTestSuite('PHP_PMD_Regression_InvalidUnusedLocalVariableAndFormalParameterTicket007Test'); | |
| 78 | 80 | |
| 79 | 81 | return $suite; |
| 80 | 82 | } |
| 185 | 186 | /test/PHP/PMD/Regression/AbstractTest.php |
| 82 | 82 | if ($localPath === '') { |
| 83 | 83 | $localPath = $trace[1]['function'] . '.php'; |
| 84 | 84 | } |
| 85 | - return parent::createFileUri('regression/' . $ticket . '/' . $localPath); | |
| 85 | + return parent::createFileUri('Regression/' . $ticket . '/' . $localPath); | |
| 86 | 86 | } |
| 87 | 87 | } |
| 185 | 186 | /test/PHP/PMD/_files/regression/001/source/FooBar.php |
| 2 | -<?php | |
| 3 | -/** | |
| 4 | - * @package ticket001 | |
| 5 | - */ | |
| 6 | -class FooBarTicket001 {} | |
| 185 | 186 | /test/PHP/PMD/AbstractTest.php |
| 157 | 157 | { |
| 158 | 158 | $frame = $this->_getCallingTestCase(); |
| 159 | 159 | |
| 160 | + if (preg_match('(_([^_]+)_[^_]+[a-z]([0-9]+)Test)i', $frame['class'], $match)) { | |
| 161 | + $localPath = $match[1] . '/' . $match[2]; | |
| 162 | + } else { | |
| 163 | + $localPath = strtr(substr($frame['class'], 8, -4), '_', '/'); | |
| 164 | + } | |
| 165 | + | |
| 160 | 166 | $sourceFile = sprintf( |
| 161 | 167 | '%s/_files/%s/%s.php', |
| 162 | 168 | dirname(__FILE__), |
| 163 | - strtr(substr($frame['class'], 8, -4), '_', '/'), | |
| 169 | + $localPath, | |
| 164 | 170 | $frame['function'] |
| 165 | 171 | ); |
| 166 | 172 | return $this->_parseSource($sourceFile); |
| 185 | 186 | /package.xml |
| 255 | 255 | <dependencies> |
| 256 | 256 | <required> |
| 257 | 257 | <php> |
| 258 | - <min>5.2.0</min> | |
| 258 | + <min>5.2.3</min> | |
| 259 | 259 | </php> |
| 260 | 260 | <pearinstaller> |
| 261 | 261 | <min>1.6.0</min> |
| 263 | 263 | <package> |
| 264 | 264 | <name>PHP_Depend</name> |
| 265 | 265 | <channel>pear.pdepend.org</channel> |
| 266 | - <min>0.9.7</min> | |
| 266 | + <min>0.9.10</min> | |
| 267 | 267 | </package> |
| 268 | 268 | <extension> |
| 269 | 269 | <name>pcre</name> |
| 274 | 274 | <extension> |
| 275 | 275 | <name>dom</name> |
| 276 | 276 | </extension> |
| 277 | + <extension> | |
| 278 | + <name>simplexml</name> | |
| 279 | + </extension> | |
| 277 | 280 | </required> |
| 278 | 281 | </dependencies> |
| 279 | 282 |