Author: maksim_ka
Date: 2010-01-20 15:13:03 +0100 (Wed, 20 Jan 2010)
New Revision: 26941
Removed:
plugins/sfPhpunitPlugin/branches/1.2/lib/vendor/
Modified:
plugins/sfPhpunitPlugin/branches/1.2/lib/test/sfPhpunitSuiteLoader.class.php
plugins/sfPhpunitPlugin/branches/1.2/modules/sfPhpunit/actions/actions.class.php
Log:
[sfPhpunitPlugin] fix problems with running test under PHPUnit 3.3.x versions.
Fix bug with sfPhpunit module. Remove SabreAMF. should be installed
separatly(from PEAR)
Modified:
plugins/sfPhpunitPlugin/branches/1.2/lib/test/sfPhpunitSuiteLoader.class.php
===================================================================
---
plugins/sfPhpunitPlugin/branches/1.2/lib/test/sfPhpunitSuiteLoader.class.php
2010-01-20 14:05:11 UTC (rev 26940)
+++
plugins/sfPhpunitPlugin/branches/1.2/lib/test/sfPhpunitSuiteLoader.class.php
2010-01-20 14:13:03 UTC (rev 26941)
@@ -165,18 +165,32 @@
if (!$path = array_shift($test_suite_files)) {
return new sfBasePhpunitTestSuite();
}
-
+
require_once $path;
- foreach (PHPUnit_Util_File::getClassesInFile($path) as $class
=> $params) {
+ foreach ($this->_getClassessInFile($path) as $class) {
$reflection = new ReflectionClass($class);
- if ($reflection->isSubclassOf('sfBasePhpunitTestSuite')) {
+ if ($reflection->isSubclassOf('sfBasePhpunitTestSuite')) {
return new $class();
- }
+ }
}
-
+
throw new Exception('The file `'.$path.'` does not contain a
suite class');
}
+ protected function _getClassessInFile($path)
+ {
+ if (version_compare(PHPUnit_Runner_Version::id(), '3.4', '<')) {
+ $classes = array();
+ foreach (PHPUnit_Util_Class::getClassesInFile($path) as
$reflection) {
+ $classes[] = $reflection->getName();
+ }
+
+ return $classes;
+ } else {
+ return array_keys(PHPUnit_Util_File::getClassesInFile($path));
+ }
+ }
+
/**
*
* @param string $path
Modified:
plugins/sfPhpunitPlugin/branches/1.2/modules/sfPhpunit/actions/actions.class.php
===================================================================
---
plugins/sfPhpunitPlugin/branches/1.2/modules/sfPhpunit/actions/actions.class.php
2010-01-20 14:05:11 UTC (rev 26940)
+++
plugins/sfPhpunitPlugin/branches/1.2/modules/sfPhpunit/actions/actions.class.php
2010-01-20 14:13:03 UTC (rev 26941)
@@ -13,7 +13,7 @@
public function executeIndex()
{
- $loader = new sfPhpunitSuiteLoader('unit/*');
+ $loader = new sfPhpunitSuiteLoader('units/*');
$loader->load();
$tree = array();
@@ -46,7 +46,7 @@
$testResult = new PHPUnit_Framework_TestResult();
$testResult->addListener($listener);
-
+
$path = str_replace('-', '/', $this->getRequestParameter('test'));
$loader = new sfPhpunitSuiteLoader($path);
$loader->load();
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.