some problems with kohana unittest (cli and web access)-Collection of common programming errors

Web access doesn’t work because in Kohana versions 3.*, the web interface is no longer present for the unittest module. The only way to run the tests out of the box is to do so via the CLI.

This can normally be done by doing the following.

  1. Open terminal
  2. change the directory to the tests directory for your application
  3. run ‘phpunit’

In addition, the tutorial is a bit out of date. A revision to unittest setup in Kohana 3.2 was suggested in: Suppressing the request when running PHPUnit with Kohana 3.2

Since it is running from the CLI, access to HTTP environment variables are not available.

Even though they are not available you can set them prior to operation by configuring them in your phpunit.xml file, according to PHPUnit documentation Configuration Appendix:

Setting PHP INI settings, Constants and Global Variables

The element and its children can be used to configure PHP settings, constants, and global variables. It can also be used to prepend the include_path.


    .
    
    
    
    
    
    
    
    
    
    

Originally posted 2013-11-27 12:01:47.