Issue

ZF-11781: Interface Error running Db Tests

Issue Type: Bug Created: 2011-09-30T07:46:28.000+0000 Last Updated: 2012-02-18T07:12:17.000+0000 Status: Closed Fix version(s): Reporter: Torsten Zander (torstenzander) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Test_PHPUnit

Related issues: Attachments: - Generic.patch

Description

Running m ythest creates the follwing output:

Starting test 'VarietyControllerTest::varietySearchAction'. [exec] PHP Fatal error: Class Zend_Test_PHPUnit_Db_Metadata_Generic contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (PHPUnit_Extensions_Database_DB_IMetaData::disable PrimaryKeys, PHPUnit_Extensions_Database_DB_IMetaData::enablePr imaryKeys) in /var/lib/jenkins/jobs/wein/workspace/source/library/zendframework/Zend/Test/PHPUnit/Db/Metadata/Generic.php on line 167

Comments

Posted by Robert Allen (zircote) on 2011-10-27T18:48:55.000+0000

<pre class="highlight">
 45 /**
 46  * Provides a basic interface for retreiving metadata from a database.
 47  *
 48  * @package    DbUnit
 49  * @author     Mike Lively 
 50  * @copyright  2010 Mike Lively 
 51  * @license    <a href="http://www.opensource.org/licenses/bsd-license.php">http://www.opensource.org/licenses/bsd-license.php</a>  BSD License
 52  * @version    Release: 1.1.0RC2
 53  * @link       <a href="http://www.phpunit.de/">http://www.phpunit.de/</a>
 54  * @since      Class available since Release 1.0.0
 55  */
 56 interface PHPUnit_Extensions_Database_DB_IMetaData
 57 {
...
105     /**
106      * Disables primary keys if rdbms does not allow setting them otherwise
107      *
108      * @param string $tableName
109      */
110     public function disablePrimaryKeys($tableName);
111 
112     /**
113      * Reenables primary keys after they have been disabled
114      *
115      * @param string $tableName
116      */
117     public function enablePrimaryKeys($tableName);
118 }

Posted by Robert Allen (zircote) on 2011-10-27T23:05:06.000+0000

Added a patch, I have only implemented these methods having not seen any immediate need or value for anything more at this time.

<pre class="highlight">
*** Zend/Test/PHPUnit/Db/Metadata/Generic.php  2011-10-27 17:59:40.000000000 -0500
--- p1  2011-10-27 17:59:20.000000000 -0500
***************
*** 164,166 ****
--- 164,184 ----
      {
          return false;
      }
+     
+     /**
+      * Disables primary keys if rdbms does not allow setting them otherwise
+      *
+      * @param string $tableName
+      */
+     public function disablePrimaryKeys($tableName)
+     {
+     }
+     
+     /**
+      * Reenables primary keys after they have been disabled
+      *
+      * @param string $tableName
+      */
+     public function enablePrimaryKeys($tableName)
+     {
+     }

Posted by Robert Allen (zircote) on 2011-10-27T23:09:37.000+0000

Patch to implement required methods.

Posted by Torsten Zander (torstenzander) on 2011-12-04T13:47:56.000+0000

Thanks Robert in which version will the patch be included can't see in 1.11.11. I usally have the zf as an svn external, which makes it hard to patch.

Posted by Adam Lundrigan (adamlundrigan) on 2011-12-04T21:58:32.000+0000

What version of PHPUnit are you attempting to use? The highest officially supported version is 3.4.x, but personally I've been using 3.5.x without any significant problems. However, 3.6 is completely unsupported, as there were BC breaks introduced with that version.

Posted by Robert Allen (zircote) on 2011-12-05T05:03:32.000+0000

Was unaware of 3.6 unsupported until after the fact.

Posted by Torsten Zander (torstenzander) on 2011-12-05T09:46:51.000+0000

@Adman as you can see here 3.6.4 is the durrent stable version: http://pear.phpunit.de/ That ist the version I use.

Posted by Torsten Zander (torstenzander) on 2011-12-05T09:47:02.000+0000

@Adman as you can see here 3.6.4 is the current stable version: http://pear.phpunit.de/ That ist the version I use.

Posted by Matthew Weier O'Phinney (matthew) on 2011-12-05T14:25:19.000+0000

Torsten -- please read Adam's comment in full. PHPUnit 3.6.4 introduces many BC breaks, and we are unwilling at this time to spend the time necessary to address them in ZF1 (when we addressed 3.4 -> 3.5 for ZF2, it took around a week of dedicated time to cleanup the test suite to work). As such, we're standardizing on the version of PHPUnit that was current during most of its development lifetime -- PHPUnit 3.4.X.

Posted by Stephen S. Musoke (ssmusoke) on 2012-02-18T07:12:17.000+0000

All users can be advised to follow the steps at http://dustyreagan.com/downgrade-phpunit-3-6-to-3-… to get the correct versions and dependencies for installing PHPUnit 3.5.15 to work around this issue

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2017 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts