1. Go to this page and download the library: Download bypikod/php-test 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/ */
bypikod / php-test example snippets
use PHPTest\Test;
Test::it("test", function (Test $test) {
$test->assertEqual(1, 2);
});
use PHPTest\Test;
Test::suite("test", function ($it) {
$it("test", function (Test $test) {
$test->assertEqual(1, 1);
});
$it("test", function (Test $test) {
$test->assertEqual(1, 2);
});
});
use PHPTest\Test;
class RouterTest extends Router
{
/**
* Test get branch
* @test Branch Getter Test
* @since 1.0.0
*/
public function getBranchTest(Test $test): void
{
// Test get branch
$this->getBranch('/a/b', false)[] = 'test';
$test->assertArrayContains($this->getBranch('/a/b', false), 'test');
// Test by popping the last element
$this->getBranch('/a/b/test', true)[] = 'test';
$test->assertArrayContains($this->getBranch('/a/b', false), 'test');
}
}
$router = new RouterTest();
Test::suiteClass($router);
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.