![]() |
unit test class with phpunit - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: unit test class with phpunit (/showthread.php?tid=92638) |
unit test class with phpunit - solmazbabakan - 03-21-2025 for my codeigniter 3 project i have creating a unit test class with phpunit: i have following test controller : PHP Code: <?php in bootstrap then i have: PHP Code: define('APPPATH', 'C:\\My_PC\\Birim Test\\...\\application\\'); when i ran on local in terminal using: PHP Code: vendor/bin/phpunit --bootstrap application/tests/bootstrap.php application/tests/UserControllerTest.php i get : PHP Code: No direct script access allowed how can i resolve that? any help? RE: unit test class with phpunit - solmazbabakan - 03-21-2025 There were 2 errors: 1) ProfilControllerTest::testSaveCommentSuccess Error: Class "CI_Blade" not found C:\My_PC\Birim Test\resuwo_online\resuwo\system\core\Common.php:196 C:\My_PC\Birim Test\resuwo_online\resuwo\system\core\Controller.php:82 C:\My_PC\Birim Test\resuwo_online\resuwo\application\core\MY_UserController.php:9 C:\My_PC\Birim Test\resuwo_online\resuwo\application\controllers\User\Profil.php:15 C:\My_PC\Birim Test\resuwo_online\resuwo\application\tests\ProfilControllerTest.php:25 2) ProfilControllerTest::testSaveCommentFailure Error: Class "CI_Blade" not found C:\My_PC\Birim Test\resuwo_online\resuwo\system\core\Common.php:196 C:\My_PC\Birim Test\resuwo_online\resuwo\system\core\Controller.php:82 C:\My_PC\Birim Test\resuwo_online\resuwo\application\core\MY_UserController.php:9 C:\My_PC\Birim Test\resuwo_online\resuwo\application\controllers\User\Profil.php:15 C:\My_PC\Birim Test\resuwo_online\resuwo\application\tests\ProfilControllerTest.php:25 ERRORS! Tests: 2, Assertions: 0, Errors: 2. |