Procházet zdrojové kódy

PHP typehinting can't be tested as it throws fatal error in PHP 7

Martin Hujer před 10 roky
rodič
revize
cd3ad20d65

+ 7 - 0
tests/Zend/Log/Writer/AbstractTest.php

@@ -37,6 +37,9 @@ require_once 'Zend/Log/Writer/Abstract.php';
  */
  */
 class Zend_Log_Writer_AbstractTest extends PHPUnit_Framework_TestCase
 class Zend_Log_Writer_AbstractTest extends PHPUnit_Framework_TestCase
 {
 {
+    /**
+     * @var Zend_Log_Writer_Abstract
+     */
     protected $_writer;
     protected $_writer;
 
 
     public static function main()
     public static function main()
@@ -55,6 +58,10 @@ class Zend_Log_Writer_AbstractTest extends PHPUnit_Framework_TestCase
      */
      */
     public function testSetFormatter()
     public function testSetFormatter()
     {
     {
+        if (version_compare(phpversion(), '7', '>=')) {
+            $this->markTestSkipped('Invalid typehinting is PHP Fatal error in PHP7+');
+        }
+
         require_once 'Zend/Log/Formatter/Simple.php';
         require_once 'Zend/Log/Formatter/Simple.php';
         $this->_writer->setFormatter(new Zend_Log_Formatter_Simple());
         $this->_writer->setFormatter(new Zend_Log_Formatter_Simple());
         $this->setExpectedException('PHPUnit_Framework_Error');
         $this->setExpectedException('PHPUnit_Framework_Error');

+ 4 - 0
tests/Zend/Log/Writer/DbTest.php

@@ -138,6 +138,10 @@ class Zend_Log_Writer_DbTest extends PHPUnit_Framework_TestCase
      */
      */
     public function testThrowStrictSetFormatter()
     public function testThrowStrictSetFormatter()
     {
     {
+        if (version_compare(phpversion(), '7', '>=')) {
+            $this->markTestSkipped('Invalid typehinting is PHP Fatal error in PHP7+');
+        }
+
         try {
         try {
             $this->writer->setFormatter(new StdClass());
             $this->writer->setFormatter(new StdClass());
         } catch (Exception $e) {
         } catch (Exception $e) {