Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trustmaster/cot-testing
Unit testing module for Cotonti CMS/CMF
https://github.com/trustmaster/cot-testing
Last synced: 23 days ago
JSON representation
Unit testing module for Cotonti CMS/CMF
- Host: GitHub
- URL: https://github.com/trustmaster/cot-testing
- Owner: trustmaster
- Created: 2012-03-21T10:08:03.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-07-26T08:45:16.000Z (over 12 years ago)
- Last Synced: 2024-10-15T21:29:44.318Z (2 months ago)
- Language: PHP
- Homepage: http://www.cotonti.com/extensions/development-maintenance/testing_module
- Size: 102 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unit testing module for Cotonti
This module automates execution of unit tests which can be bundled with Cotonti core and extensions.
## Installation
1. Download this repository as .zip or .tar.gz file and unpack it to some folder.
2. Copy "testing" folder to you Cotonti modules directory.
3. Go to Administration / Extensions and install the module.## Getting started
Instructions on testing and writing tests are given on the module page itself.
Open it in your browser via http://example.com/index.php?e=testing or http://example.com/testing (depending on your URL settings).For example, if you develop a module called 'myext', you can create a test file called 'myext/test/myext.test.php' and put a following function in it:
```php
// Include functions from your module
require_once cot_incfile('myext', 'module');// This function tests myext_foo()
// you can do multiple tests in a single function or file
function test_myext_foo()
{
$res = myext_foo('bar');
if ($res === 'baz')
{
return true;
}
else
{
return 'myext_foo() returned ' . $res;
}
}
```Then you can open testing module and run tests for this particular extension or entire site at once.
For more information please visit [module page at Cotonti Extensions](http://www.cotonti.com/extensions/development-maintenance/testing_module)