Welcome Guest, Not a member yet? Register   Sign In
Search Results
    Thread: phpUnit test working directory
Post: RE: phpUnit test working directory

paul Wrote: (11-25-2021, 08:01 AM) -- I run tests with : php 'c:/wamp64/codeigniter4/vendor/phpunit/phpunit/phpunit' --colors=always -c c:/wamp64/codeigniter4/phpunit.xml --testsuite 'app' -- I be...
2,499 Views
3 Replies
11-25-2021, 09:48 AM
Taras
    Thread: phpUnit test working directory
Post: RE: phpUnit test working directory

Do you try to run tests from public? You should run them from your projects dir like "./vendor/bin/phpunit" and it should work without any tweaks.
2,499 Views
3 Replies
11-25-2021, 07:20 AM
Taras
    Thread: Feature test http responses interfere between tests
Post: RE: Feature test http responses interfere between ...

It turned out that issue was caused by redirect in controller in post action: PHP Code: --         return $this->response->redirect(route_to('abc.view', $id)); -- I replaced it with: PHP Code: -- ...
988 Views
1 Replies
09-09-2021, 11:04 AM
Taras
    Thread: Feature test http responses interfere between tests
Post: Feature test http responses interfere between test...

Hello I am writing feature tests that access post and get endpoints. PHP Code: -- public function testAbc() {     $data = ['a' => 'a'];     $response = $this->post('abc', $data);     $response->asser...
988 Views
1 Replies
09-07-2021, 08:42 AM
Taras
    Thread: Error 500 - CLI.php - Use of undefined constant STDOUT
Post: RE: Error 500 - CLI.php - Use of undefined constan...

paulbalandan Wrote: (08-18-2021, 09:00 PM) -- Hi! Your issue, along with some others, has a fix already in the provisional 4.2 branch. -- Thanks, that code works fine too.
8,918 Views
12 Replies
08-19-2021, 08:00 AM
Taras
    Thread: Validation in controller for "patch" request
Post: RE: Validation in controller for "patch" request

Ok, I've found solution. I have to run validation manually supplying data gathered with getVar. PUT does this automatically though. But it that case I have some troubles in creating test request wi...
1,095 Views
1 Replies
08-19-2021, 03:48 AM
Taras
    Thread: Validation in controller for "patch" request
Post: Validation in controller for "patch" request

Hello! I want to add "update" action to controller as patch. I've created this test: PHP Code: -- $attributes = ['title' => 'Changed Title']; $response = $this->patch(route_to('project.update', 1...
1,095 Views
1 Replies
08-18-2021, 12:32 AM
Taras
    Thread: Error 500 - CLI.php - Use of undefined constant STDOUT
Post: RE: Error 500 - CLI.php - Use of undefined constan...

As I understand, the problem appears because request from browser incorrectly identified as CLI one. This is why those constants are undefined. @"InsiteFX", I tried to put those definitions. Now I ...
8,918 Views
12 Replies
08-16-2021, 01:20 AM
Taras
    Thread: Error 500 - CLI.php - Use of undefined constant STDOUT
Post: RE: Error 500 - CLI.php - Use of undefined constan...

After some investigation I found that there are changes in system/Common.php for is_cli() method that cause current issue. It's identified as CLI in condition: PHP Code: -- if (stristr(PHP_SAPI...
8,918 Views
12 Replies
08-15-2021, 01:21 AM
Taras
    Thread: Error 500 - CLI.php - Use of undefined constant STDOUT
Post: RE: Error 500 - CLI.php - Use of undefined constan...

Hi, have you found solution? Same here after updating from the v4.1.1. When I run "php spark serve" it works fine.
8,918 Views
12 Replies
08-14-2021, 11:03 AM
Taras

Theme © iAndrew 2016 - Forum software by © MyBB