quarkdev/tendo

v0.1.1 2016-04-25 00:10 UTC

This package is auto-updated.

Last update: 2024-10-20 12:32:28 UTC


README

Tendo is a really simple testing framework inspired by Ava.

How to run

composer require 'quarkdev/tendo'

Example

<?php
use Tendo\Tendo;

require 'vendor/autoload.php';

$test = new Tendo();

$test('title', function($t) {
    $t->pass(); // yes
});

$test('title 2', function($t) {
    $t->is(123, '123'); // nop
});

$test('Plan', function($t) {
    $t->plan(2);

    for ($i = 0; $i < 3; $i++) {
        $t->true($i < 3);
    }
}); // fails, 3 assertions are executed which is too many

$test->results();

Command line example

The $test variable is auto injected, you dont have to instantiate Tendo.

Example with myTest.php:

<?php
$test('title', function($t) {
    $t->pass(); // yes
});

$test('title 2', function($t) {
    $t->is(123, '123'); // nop
});

You can now run the test via the command line :

./vendor/bin/tendo myTest.php

Note: You can run multiple tests via the commande line ./vendor/bin/tendo test1.php test2.php ....