• 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ci-phpunit-test for CodeIgniter 3.0

#81
(04-22-2017, 06:05 PM)kenjis Wrote: I've just released v0.15.0!

See https://github.com/kenjis/ci-phpunit-test/releases

Hi Kenjis

I installed your latest and phpunit seemed to hang with nothing happening
I tried the Welcome_test.php

The dump screen as follows:
==begin ==
[email protected]:/var/www/r.dm.net/application/tests$ ../../vendor/bin/phpunit controllers/Welcome_test.php

PHPUnit 4.8.35 by Sebastian Bergmann and contributors.

(BLANK SPACE ) 
==end===


I used CI 3.1.4 and phpunit 4.8.35 /4.7.7 (none of them working! )

I wonder if I do missed anything

Many thanks
Reply

#82
(06-06-2017, 04:52 PM)ciadvantage Wrote: Hi Kenjis

I installed your latest and phpunit seemed to hang with nothing happening
I tried the Welcome_test.php

The dump screen as follows:
==begin ==
[email protected]:/var/www/r.dm.net/application/tests$ ../../vendor/bin/phpunit controllers/Welcome_test.php

PHPUnit 4.8.35 by Sebastian Bergmann and contributors.

(BLANK SPACE ) 
==end===


I used CI 3.1.4 and phpunit 4.8.35 /4.7.7 (none of them working! )

I wonder if I do missed anything

Many thanks

You just misunderstand where you are.
You are in `application/tests`. So `Welcome_test.php` is located in `../controllers/Welcome_test.php`.
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#83
Hi
How I can integrate Codeigniter 3 (CI3) sessions to ci-phpunit-test (CIPUT), because now CIPUT and CI3 have different sessions (header page code 307 for all pages)

I need test CI3 via CIPUT as registered user with same sessions.

Is it possible ?
Reply

#84
See https://github.com/kenjis/ci-app-for-ci-...s_test.php
for tests with sessions.
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#85
Hello everyone,

I'm trying to test GroceryCRUD pages with ci-phpunit-test, but I have strange result.

PHP Code:
class Examples_test extends TestCase
{
    public function 
test_index()
    {
            
// Test OK
        
$this->request('GET''examples/customers_management');
        
$this->assertResponseCode(200);
        
        
// Test ~= NOK
        
$this->ajaxRequest('POST''examples/customers_management/ajax_list', [
            
'page' => 1,
            
'per_page' => 10,
            
'oder_by' => ['contactLastName''asc'],
            
'search_field' => ['contactLastName'],
            
'search_text' => ['ben'],
        ]);
        
$this->assertResponseCode(200);
    }



When I use ajaxRequest, I doesn't show assertion result. I show the ajax result in my console.

Any idea ?

Thanks

PS: thank you so much kenjis and John, Your libraries are fantastic. I use them every job day.
Reply

#86
> When I use ajaxRequest, I doesn't show assertion result. I show the ajax result in my console.

It is strange, because the only difference between `ajaxRequest` and `request` is just
to add `$_SERVER['HTTP_X_REQUESTED_WITH'] = 'xmlhttprequest'` or not.
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.