[wp-trac] [WordPress Unit Tests] #107: Fatal error in factory.php when running multisite tests

WordPress Trac wp-trac at lists.automattic.com
Mon Jul 16 17:10:08 UTC 2012


#107: Fatal error in factory.php when running multisite tests
--------------------------+-----------------
 Reporter:  ryan          |      Owner:
     Type:  defect        |     Status:  new
 Priority:  normal        |  Milestone:
Component:  Admin Screen  |   Keywords:
--------------------------+-----------------
 {{{
 Fatal error: Cannot use object of type WP_Error as array in
 /Users/ryan/Projects/unit-tests/trunk/includes/factory.php on line 121

 Call Stack:
     0.0003     325344   1. {main}()
 /Applications/XAMPP/xamppfiles/bin/phpunit:0
     0.0058     670744   2. PHPUnit_TextUI_Command::main()
 /Applications/XAMPP/xamppfiles/bin/phpunit:46
     0.0059     671148   3. PHPUnit_TextUI_Command->run()
 /Applications/XAMPP/xamppfiles/lib/php/pear/PHPUnit/TextUI/Command.php:130
     1.7819   44599936   4. PHPUnit_TextUI_TestRunner->doRun()
 /Applications/XAMPP/xamppfiles/lib/php/pear/PHPUnit/TextUI/Command.php:192
     1.7868   44911160   5. PHPUnit_Framework_TestSuite->run()
 /Applications/XAMPP/xamppfiles/lib/php/pear/PHPUnit/TextUI/TestRunner.php:325
   194.3344   61915340   6. PHPUnit_Framework_TestSuite->run()
 /Applications/XAMPP/xamppfiles/lib/php/pear/PHPUnit/Framework/TestSuite.php:705
   195.7250   63395524   7. PHPUnit_Framework_TestSuite->runTest()
 /Applications/XAMPP/xamppfiles/lib/php/pear/PHPUnit/Framework/TestSuite.php:745
   195.7250   63395524   8. PHPUnit_Framework_TestCase->run()
 /Applications/XAMPP/xamppfiles/lib/php/pear/PHPUnit/Framework/TestSuite.php:772
   195.7251   63395524   9. PHPUnit_Framework_TestResult->run()
 /Applications/XAMPP/xamppfiles/lib/php/pear/PHPUnit/Framework/TestCase.php:751
   195.7253   63396636  10. PHP_Invoker->invoke()
 /Applications/XAMPP/xamppfiles/lib/php/pear/PHPUnit/Framework/TestResult.php:647
   195.7253   63396476  11. call_user_func_array()
 /Applications/XAMPP/xamppfiles/lib/php/pear/PHP/Invoker.php:93
   195.7253   63396608  12. PHPUnit_Framework_TestCase->runBare()
 /Applications/XAMPP/xamppfiles/lib/php/pear/PHP/Invoker.php:93
   195.7456   63460144  13. PHPUnit_Framework_TestCase->runTest()
 /Applications/XAMPP/xamppfiles/lib/php/pear/PHPUnit/Framework/TestCase.php:804
   195.7456   63460912  14. ReflectionMethod->invokeArgs()
 /Applications/XAMPP/xamppfiles/lib/php/pear/PHPUnit/Framework/TestCase.php:942
   195.7457   63460928  15. TestWPQueryVars->test_category_feed()
 /Applications/XAMPP/xamppfiles/lib/php/pear/PHPUnit/Framework/TestCase.php:942
   195.7457   63461264  16. WP_UnitTest_Factory_For_Thing->create()
 /Users/ryan/Projects/unit-tests/trunk/tests/test_query.php:371
   195.7458   63461936  17. WP_UnitTest_Factory_For_Term->create_object()
 /Users/ryan/Projects/unit-tests/trunk/includes/factory.php:166
 }}}

 WP_Error looks like:

 {{{
 WP_Error::__set_state(array(
    'errors' =>
   array (
     'db_insert_error' =>
     array (
       0 => 'Could not insert term into the database',
     ),
   ),
    'error_data' =>
   array (
     'db_insert_error' => 'Table \'wp_unit_test.wp_31_terms\' doesn\'t
 exist',
   ),
 ))
 }}}

-- 
Ticket URL: <http://unit-tests.trac.wordpress.org/ticket/107>
WordPress Unit Tests <http://unit-tests.trac.wordpress.org>
My example project


More information about the wp-trac mailing list