Updated Development (markdown)

El RIDO 2015-08-30 23:46:06 +02:00
parent f6c38ef1eb
commit 7de83e0f75

@ -14,7 +14,7 @@ More details can be found in the [API documentation](https://zerobin.dssr.ch/doc
## Unit Tests
For unit tests of the php code the folder `tst/` should be used. Apart from helping to implement new features correctly it should help us to keep regressions at bay. By default a code coverage report is generated after phpunit is run, the one of the latest release is [publicly available](https://zerobin.dssr.ch/coverage-report/).
For unit tests of the php code the folder `tst/` can be used. Apart from helping to implement new features correctly it helps to keep regressions at bay. By default a code coverage report is generated after phpunit is run, the one of the latest release is [publicly available](https://zerobin.dssr.ch/coverage-report/).
In order to run these tests, you will need the following packages and its dependencies:
* phpunit
@ -31,6 +31,14 @@ To run the tests, just change into the `tst/` directory and run phpunit:
$ cd ZeroBin/tst
$ phpunit
Additionally there is the `configGenerator`. Based on the configurations defined in its constructor, it generates the unit test file `tst/configuration.php`, containing all possible combinations of these configurations and test for (most) valid combinations. Some of combinations can't be tested with this method, i.e. a valid option combined with an invalid one. Other very specific test cases (i.e. to trigger multiple errors) are covered in `tst/zerobin.php`. Here is how to generate the configuration test and run it:
$ cd ZeroBin/tst
$ php configGenerator.php
$ phpunit configuration.php
Note that it can take an hour or longer to run the several thousand tests.
## Data Model
If you want to create your own data models, you might want to know how the arrays, that you have to store, look like: