unit test class with phpunit |
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?
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. |
Welcome Guest, Not a member yet? Register Sign In |