Unit testing problem.

  • Hi all,

    I hope to make some enhancements to orangeHRM and contribute. So far I can't get past the unit testing because of errors finding the include files on the the required modules.

    For example:

    On AjaxCalls.php, the ROOT_PATH variable remains undefined. This in turn leads to a failed to open stream: Invalid argument [line 20 …
    If you explicitly define the path on one file it will pass on to the next file that uses the ROOT_PATH and output a similar error. The ROOT_PATH variable is defined in testConf.php which in turn takes it from myconf.php on the build/ directory. I have yet to see where in the files is included the testConf.php or executed in the process so that this variable defines itself in execution so that the tests don't fail. Is there a file which includes testConf.php and is incluided in all the other files?

    Thanks for the assistance.

  • Hi,

    You may contact OrangeHRM directly if you like to contribute.
    Please contact "Gayanath Jayarathne" <gayanath@orangehrm.com> and cc it to support@orangehrm.com


  • Ok so I narrow at least one test set, the first, can someone tell me
    how to make the pass?

    phpunit -verbose authorizeTest_common_AllTests
    PHPUnit 3.5.5 by Sebastian Bergmann.

    Cannot open file "./authorizeTest/common/AllTests.php".
    phpunit -verbose authorizeTest_common_AllTests AllTests.php
    PHP Notice: Please no longer include "PHPUnit/Framework.php". in
    /usr/share/php/PHPUnit/Framework.php on line 50
    PHPUnit 3.5.5 by Sebastian Bergmann.

    OrangeHRM common





    Time: 01:11, Memory: 7.25Mb

    There were 4 failures:

    1) authorizeTest::testIsSupervisor2
    Supervisor not an Supervisor
    Failed asserting that <boolean:true> matches expected <boolean:false>.


    2) authorizeTest::testIsTheSupervisor2
    The supervisor of unknown emplyee
    Failed asserting that <boolean:true> matches expected <boolean:false>.


    3) authorizeTest::testFirstRole2
    Didn't return the first
    Failed asserting that <string:Supervisor> matches expected <boolean:false>.


    4) authorizeTest::testIsActionPermitted
    Supervisor should be permitted action TCP
    Failed asserting that <boolean:false> is true.


    Tests: 48, Assertions: 924, Failures: 4.