|Classes of Barton Phillips||>||PHP Site Class||>||docs/testing.md||>||Download|
You will need to insure that 'phpunit' is installed. 'phpunit' is on GitHub checkout the README for instalation instruction.
Once you have 'phpunit' installed you can run the following test:
From 'tests' directory enter:
Where 'path_to_autoload.php' is the path to the location of 'vendor/autoload.php', and 'filename' is one of the three file that follow:
To use the 'withMysql.php' test you will need to setup the MySql database. First you will need to create a database 'siteclass'. Then you will need to grand priveleges.
Now you can run the 'withMysql.php' with:
There is already a Sqlite3 database in the 'tests' directory. It is called just 'siteclass'. You can run the 'withSqlite3.php' with:
Top Bottom Test
The final test 'topBottom.php' does not need a database and only test the 'getPageHead', 'getPageFooter' and 'getPageTopBottom' methods and the 'includes/' files.
Feel free to extend the test if you like.