-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codeigniter 2 and codeception #13
Comments
Sorry, bootstrap files work only with native Cest or Cept formats. |
oke so i should rewrite the unit test to a cest? |
No, there is no need in doing so. All the formats should be equal. |
great ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
CI = &get_instance(); $this->CI->load->database('testing'); } public function testGetsAllPosts() { $this->CI->load->model('post'); $posts = $this->CI->post->getAll(); $this->assertEquals(1, count($posts)); } ``` } and this is my bootstrap: http://conversal.w0p.be/tests/unit/_bootstrap.phps when i run codecept run unit --bedug i get this: Running PostTest::testGetsAllPosts PHP Fatal error: Call to undefined function get_instance() in /var/www/sites/conversal.w0p.be/tests/unit/PostTest.php on line 9 PHP Stack trace: PHP 1. {main}() /usr/bin/codecept:0 PHP 2. Symfony\Component\Console\Application->run() /usr/bin/codecept:39 PHP 3. Symfony\Component\Console\Application->doRun() /usr/share/php/Codeception/vendor/Symfony/Component/Console/Application.php:105 PHP 4. Symfony\Component\Console\Command\Command->run() /usr/share/php/Codeception/vendor/Symfony/Component/Console/Application.php:188 PHP 5. Codeception\Command\Run->execute() /usr/share/php/Codeception/vendor/Symfony/Component/Console/Command/Command.php:227 PHP 6. Codeception\Codecept->runSuite() /usr/share/php/Codeception/src/Codeception/Command/Run.php:57 PHP 7. Codeception\SuiteManager->run() /usr/share/php/Codeception/src/Codeception/Codecept.php:89 PHP 8. Codeception\PHPUnit\Runner->doEnhancedRun() /usr/share/php/Codeception/src/Codeception/SuiteManager.php:130 PHP 9. PHPUnit_Framework_TestSuite->run() /usr/share/php/Codeception/src/Codeception/PHPUnit/Runner.php:97 PHP 10. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705 PHP 11. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745 PHP 12. PHPUnit_Framework_TestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:772 PHP 13. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:751 PHP 14. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHPUnit/Framework/TestResult.php:650 PHP 15. PostTest->setUp() /usr/share/php/PHPUnit/Framework/TestCase.php:801 FATAL ERROR OCCURRED. TESTS NOT FINISHED. it looks like it doens't load the _bootstrap?i have a clean CodeIgniter framework version 2 installed.
And created a phpunit test in /tests/unit/PostTest.php with following contents:
The text was updated successfully, but these errors were encountered: