|
|
@@ -53,23 +53,25 @@ class Zend_File_ClassFileLocatorTest extends PHPUnit_Framework_TestCase
|
|
|
|
|
|
public function testIterationShouldReturnOnlyPhpFiles()
|
|
|
{
|
|
|
+ if (version_compare(PHP_VERSION, '5.3', 'lt')) {
|
|
|
+ $this->markTestSkipped('Test can only be run under 5.3 or later');
|
|
|
+ }
|
|
|
+
|
|
|
$locator = new Zend_File_ClassFileLocator(dirname(__FILE__));
|
|
|
foreach ($locator as $file) {
|
|
|
- if (version_compare(PHP_VERSION, '5.3', 'lt') && $file->getFileName() == 'MultipleClassesInMultipleNamespaces.php') {
|
|
|
- continue;
|
|
|
- }
|
|
|
$this->assertRegexp('/\.php$/', $file->getFilename());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public function testIterationShouldReturnOnlyPhpFilesContainingClasses()
|
|
|
{
|
|
|
+ if (version_compare(PHP_VERSION, '5.3', 'lt')) {
|
|
|
+ $this->markTestSkipped('Test can only be run under 5.3 or later');
|
|
|
+ }
|
|
|
+
|
|
|
$locator = new Zend_File_ClassFileLocator(dirname(__FILE__));
|
|
|
$found = false;
|
|
|
foreach ($locator as $file) {
|
|
|
- if (version_compare(PHP_VERSION, '5.3', 'lt') && $file->getFileName() == 'MultipleClassesInMultipleNamespaces.php') {
|
|
|
- continue;
|
|
|
- }
|
|
|
if (preg_match('/locator-should-skip-this\.php$/', $file->getFilename())) {
|
|
|
$found = true;
|
|
|
}
|
|
|
@@ -79,12 +81,13 @@ class Zend_File_ClassFileLocatorTest extends PHPUnit_Framework_TestCase
|
|
|
|
|
|
public function testIterationShouldReturnInterfaces()
|
|
|
{
|
|
|
+ if (version_compare(PHP_VERSION, '5.3', 'lt')) {
|
|
|
+ $this->markTestSkipped('Test can only be run under 5.3 or later');
|
|
|
+ }
|
|
|
+
|
|
|
$locator = new Zend_File_ClassFileLocator(dirname(__FILE__));
|
|
|
$found = false;
|
|
|
foreach ($locator as $file) {
|
|
|
- if (version_compare(PHP_VERSION, '5.3', 'lt') && $file->getFileName() == 'MultipleClassesInMultipleNamespaces.php') {
|
|
|
- continue;
|
|
|
- }
|
|
|
if (preg_match('/LocatorShouldFindThis\.php$/', $file->getFilename())) {
|
|
|
$found = true;
|
|
|
}
|
|
|
@@ -113,12 +116,13 @@ class Zend_File_ClassFileLocatorTest extends PHPUnit_Framework_TestCase
|
|
|
|
|
|
public function testIterationShouldInjectClassInFoundItems()
|
|
|
{
|
|
|
+ if (version_compare(PHP_VERSION, '5.3', 'lt')) {
|
|
|
+ $this->markTestSkipped('Test can only be run under 5.3 or later');
|
|
|
+ }
|
|
|
+
|
|
|
$locator = new Zend_File_ClassFileLocator(dirname(__FILE__));
|
|
|
$found = false;
|
|
|
foreach ($locator as $file) {
|
|
|
- if (version_compare(PHP_VERSION, '5.3', 'lt') && $file->getFileName() == 'MultipleClassesInMultipleNamespaces.php') {
|
|
|
- continue;
|
|
|
- }
|
|
|
$classes = $file->getClasses();
|
|
|
foreach ($classes as $class) {
|
|
|
$found = true;
|