Unzer/tests/unittests
2024-05-08 10:44:47 +02:00
..
libs add 6.4.3.1 (ionCube for PHP 7.1 to 7.4) 2024-05-08 10:44:47 +02:00
phpmd add 6.2.0.0 (ionCube for PHP 7.1 - 7.4) 2020-10-28 12:04:48 +01:00
unit add 6.4.3.1 (ionCube for PHP 7.1 to 7.4) 2024-05-08 10:44:47 +02:00
additional.inc.php add 6.4.3.1 (ionCube for PHP 7.1 to 7.4) 2024-05-08 10:44:47 +02:00
bootstrap.php add 6.4.3.1 (ionCube for PHP 7.1 to 7.4) 2024-05-08 10:44:47 +02:00
MC_Metrics.php add 6.4.3.1 (ionCube for PHP 7.1 to 7.4) 2024-05-08 10:44:47 +02:00
phpunit_masterpass.xml add 6.2.0.0 (ionCube for PHP 7.1 - 7.4) 2020-10-28 12:04:48 +01:00
phpunit.xml add 6.2.0.0 (ionCube for PHP 7.1 - 7.4) 2020-10-28 12:04:48 +01:00
phpunitpci3.xml add 6.2.0.0 (ionCube for PHP 7.1 - 7.4) 2020-10-28 12:04:48 +01:00
readme.txt add 6.2.0.0 (ionCube for PHP 7.1 - 7.4) 2020-10-28 12:04:48 +01:00
runcoverage.bat add 6.2.0.0 (ionCube for PHP 7.1 - 7.4) 2020-10-28 12:04:48 +01:00
runcoverage.sh add 6.2.0.0 (ionCube for PHP 7.1 - 7.4) 2020-10-28 12:04:48 +01:00
runmetrics.bat add 6.2.0.0 (ionCube for PHP 7.1 - 7.4) 2020-10-28 12:04:48 +01:00
runmetrics.sh add 6.2.0.0 (ionCube for PHP 7.1 - 7.4) 2020-10-28 12:04:48 +01:00
runtests.bat add 6.2.0.0 (ionCube for PHP 7.1 - 7.4) 2020-10-28 12:04:48 +01:00
runtests.sh add 6.2.0.0 (ionCube for PHP 7.1 - 7.4) 2020-10-28 12:04:48 +01:00

# Generic test folder 

### Usage:

* Copy the folder "tests" directly into your module directory, for example: **"eshop/modules/oxps/mymodule/"**
* Add new tests by adding files to **"tests/unit/module"** folder
* To run all the tests just run the script **"tests/runtests.sh"**
* To run a particular test class, just run the same script but add a path to the file: **EXAMPLE:** ./runtests.sh ./unit/module/somefileTest.php
* To run code coverage run the "runcoverage.sh" script. **IMPORTANT:** Activate the module in the ADMIN before running the coverage.
* If needs exclude some directorys or files, for that needs edit phpunit.xml file. 
For example if needs remove directory with content named testFiles needs in bracket add new line like: 
	
	< whitelist addUncoveredFilesFromWhitelist="true">	 
    < directory suffix=".php">../</directory>
	< exclude>
		....
		< directory suffix=".php">../testFiles/</directory>
		....
	< /exclude>
		
* If module does not have vendor directory and is stored modules/moduleName, then needs edit phpunit.xml file and change path where can be found all shop original files and directorys:
	List for module with vendor directory:
	< blacklist>
        < directory suffix=".php">../../../../</directory>
    < /blacklist>
	
	List for module without vendor directory:
	
	< blacklist>
        < directory suffix=".php">../../../</directory>
    </ blacklist>
	
* To run metrics first needs install pDepend(PHP depend - tool for metrics generation, default which was in PHPUNIT 3.4.* was removed in newest versions). how to do it is wrote there http://pdepend.org/download/index.html.
* To run metrics is just enough execute file ./runmetrics.sh with root user right(required for writing)