PHP code example of atk14 / tester

1. Go to this page and download the library: Download atk14/tester 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/ */

    

atk14 / tester example snippets



// file: test/tc_first_test_case.php
class TcFirstTestCase extends TcBase {

  function test_sum(){
    $this->assertEquals(6, 3 + 3);
  }

  function test_multiplication(){
    $this->assertEquals(9, 3 * 3);
  }
}


// file: test/initialize.php


// file: test/tc_base.php
class TcBase extends TcSuperBase {

  function _setUp(){
    // runs before each test method
  }

  function _tearDown(){
    // runs after each test method
  }
}


// file: test/initialize.php

if(preg_match('/_theme_dark\.php$/', $_TEST["FILENAME"])){
  define("COLOR_BACKGROUND", "#000000");
  define("COLOR_TEXT",       "#999999");
} else {
  define("COLOR_BACKGROUND", "#FFFFFF");
  define("COLOR_TEXT",       "#333333");
}