/tests
directory. It is organized in 3 distinct Test Suites, defined in the phpunit.xml
file:
mantis
: MantisBT Core tests
soap
: SOAP API tests
rest
: REST API tests
Warning
XxxxxTest.php
, where Xxxxx is the Test's name. The Test.php suffix allows the script to be automatically picked up by PHPUnit when running the Test Suite. Without this suffix, the new script will have to be declared manually with a <file>
tag in the phpunit.xml
file's relevant <testsuite>
section.
Mantis\tests
with global helper classes in Mantis\tests\core
and subnamespaces for each test suite (Mantis
, rest
and soap
). It is possible to further break down the namespace hierarchy, to regroup related test cases e.g. Mantis\tests\Mantis\Helper
.
composer install
, which ensures that you have the appropriate version to run the unit tests.
composer.json
file to find out which version to use.
build/ci_post_install.sh
script for SQL statements to create the necessary data.
Warning
config_inc.php
file to ensure all PHPUnit tests are executed. Without this, some tests will be skipped
$g_allow_no_category = ON; $g_due_date_update_threshold = DEVELOPER; $g_due_date_view_threshold = DEVELOPER; $g_enable_product_build = ON; $g_enable_project_documentation = ON; $g_time_tracking_enabled = ON; $g_allow_anonymous_login = ON; $g_anonymous_account = 'username'; # of the anonymous account created above
bootstrap.php
file, which must be adjusted to run the tests on your local installation. The tests/boostrap.php.sample
file contains the settings you will need to adjust to run all the tests.
require_once 'vendor/autoload.php';and set the following variables
MANTIS_TESTSUITE_USERNAME
, MANTIS_TESTSUITE_PASSWORD
and MANTIS_TESTSUITE_PROJECT_ID
MANTIS_TESTSUITE_SOAP_ENABLED
and MANTIS_TESTSUITE_SOAP_HOST
MANTIS_TESTSUITE_REST_ENABLED
, MANTIS_TESTSUITE_REST_HOST
and MANTIS_TESTSUITE_API_TOKEN