Quick Start
To start using phpRack you should do three operations:
- To upload phpRack library to your server
- To create phprack.php file in your public_html directory
- To create PHP integration tests in your rack-tests directory
Let's do them one by one:
1. To upload phpRack library
You should attach phpRack SVN repository to your project repository, or upload phpRack to your server (see Download page for details). We encourage you to use the first option, but the second one is OK for smaller projects.
2. To create phprack.php
You should create phprack.php in your project's public directory (see full reference), e.g.:
<?php // this param is mandatory, others are optional $phpRackConfig = array( 'dir' => '../rack-tests', ); // absolute path to the bootstrap script on your server include '../library/phpRack/bootstrap.php';
3. To create integration tests
Write integration tests in the directory rack-tests, each one has to extend the class PhpRack_Test (see full list of assertions). For example, file MyTest.php:
<?php class MyTest extends phpRack_Test { public function testPhpVersionIsCorrect() { $this->assert->php->version ->atLeast('5.2'); } public function testPhpExtensionsExist() { $this->assert->php->extensions ->isLoaded('xsl') ->isLoaded('simplexml') ->isLoaded('fileinfo'); } }
Go to the URL: http://your-website-url/phprack.php and enjoy. Try this link to see what you're going to see on your site: http://www.phprack.com/phprack.php
That's it :)
