PHP code example of tpc2 / phprack

1. Go to this page and download the library: Download tpc2/phprack library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tpc2 / phprack example snippets



// this param is mandatory, others are optional
$phpRackConfig = array(
    'dir' => '../rack-tests',
);
// absolute path to the bootstrap script on your server


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');
  }
}