Sfoglia il codice sorgente

ZF-8809
- Various win32 issues:
- Added abstract to CommonBackendTest
- Fixed line ending issues in Zend_CodeGenerator_Php_PropertyTest
- Fixed file deletion failures on win32 in Zend_Paginator tests
- Fixed failing test in Zend_Validate_BarcodeTest (win32 specific)
- Disabled compression test in Zend_Validate_File when system is buggy

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20443 44c647ce-9c0f-0410-b52a-842ac1e357ba

ralph 16 anni fa
parent
commit
0127ed3724

+ 1 - 1
tests/Zend/Cache/CommonBackendTest.php

@@ -37,7 +37,7 @@ require_once 'PHPUnit/Framework/TestCase.php';
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @group      Zend_Cache
  */
-class Zend_Cache_CommonBackendTest extends PHPUnit_Framework_TestCase {
+abstract class Zend_Cache_CommonBackendTest extends PHPUnit_Framework_TestCase {
 
     protected $_instance;
     protected $_className;

+ 4 - 1
tests/Zend/CodeGenerator/Php/PropertyTest.php

@@ -88,7 +88,10 @@ EOS;
             'defaultValue' => $targetValue
             ));
 
-        $this->assertEquals($expectedSource, $property->generate());
+        $targetSource = $property->generate();
+        $targetSource = str_replace("\r", '', $targetSource);
+            
+        $this->assertEquals($expectedSource, $targetSource);
     }
 
     public function testPropertyCanProduceContstantModifier()

+ 2 - 1
tests/Zend/PaginatorTest.php

@@ -166,7 +166,7 @@ class Zend_PaginatorTest extends PHPUnit_Framework_TestCase
 
     protected function _getTmpDir()
     {
-        $tmpDir = sys_get_temp_dir() . '/zend_paginator';
+        $tmpDir = rtrim(sys_get_temp_dir(), '/\\') . DIRECTORY_SEPARATOR . 'zend_paginator';
         if (file_exists($tmpDir)) {
             $this->_rmDirRecursive($tmpDir);
         }
@@ -185,6 +185,7 @@ class Zend_PaginatorTest extends PHPUnit_Framework_TestCase
                 $this->_rmDirRecursive($file->getPathname());
             }
         }
+        unset($file, $dir); // required on windows to remove file handle
         if (!rmdir($path)) {
             throw new Exception('Unable to remove temporary directory ' . $path
                                 . '; perhaps it has a nested structure?');

+ 1 - 1
tests/Zend/Validate/BarcodeTest.php

@@ -58,7 +58,7 @@ class Zend_Validate_BarcodeTest extends PHPUnit_Framework_TestCase
             $barcode = new Zend_Validate_Barcode('Zend_Validate_BarcodeTest_NonExistentClassName');
             $this->fail("'Zend_Validate_BarcodeTest_NonExistentClassName' is not a valid barcode type'");
         } catch (Exception $e) {
-            $this->assertContains('not found', $e->getMessage());
+            $this->assertRegExp('#not found|No such file#', $e->getMessage());
         }
     }
 

+ 9 - 0
tests/Zend/Validate/File/IsCompressedTest.php

@@ -65,6 +65,15 @@ class Zend_Validate_File_IsCompressedTest extends PHPUnit_Framework_TestCase
      */
     public function testBasic()
     {
+        if (!extension_loaded('fileinfo') &&
+            function_exists('mime_content_type') && ini_get('mime_magic.magicfile') &&
+            (mime_content_type(dirname(__FILE__) . '/_files/test.zip') == 'text/plain')
+            ) {
+            $this->markTestSkipped('This PHP Version has no finfo, has mime_content_type, '
+                . ' but mime_content_type exhibits buggy behavior on this system.'
+                );
+        }
+        
         $valuesExpected = array(
             array(null, true),
             array('zip', true),