2017 © Pedro Peláez
 

library tester-php

image

dan-da/tester-php

  • Thursday, July 19, 2018
  • by danda
  • Repository
  • 1 Watchers
  • 0 Stars
  • 213 Installations
  • PHP
  • 1 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 35 % Grown

The README.md

tester-php

A simple one-file php test harness., (*1)

This is a very lightweight test harness that can be easily installed with composer, or you can just copy the tester.php file into your own project., (*2)

Let's see an example test.

The test is in file eq.test.php., (*3)

<?php

namespace tester;

class eq extends test_base {

    public function runtests() {
        $this->test1();
    }

    protected function test1() {

        $this->eq( 1, "1.00", 'one' );
        $this->eq( 2, "2.00", 'two' );
    }

}

And now let's execute it.

$ ../tester.php 
Running tests in eq...
[pass] 1 == 1.00  |  one
[pass] 2 == 2.00  |  two


2 tests passed.
0 tests failed.

Usage

   tester.php [testfilename]

   By default, all files matching *.test.php in current directory will be run.

Installation and Running.

Library install

Normally you would install tester-php into your own project using a composer require in your project's composer.json, eg:, (*4)

    "require": {
        "dan-da/tester-php"
    }

Then run composer install., (*5)

tester.php is then available at /vendor/bin/tester.php., (*6)

Standalone install

 git clone https://github.com/dan-da/hd-wallet-derive
 cd hd-wallet-derive
 php -r "readfile('https://getcomposer.org/installer');" | php
 php composer.phar install

Run tests.

$ cd tests
$ ../tester.php

Todos

  • add more example test cases
  • add proper help/usage.

The Versions

19/07 2018

dev-master

9999999-dev

  Sources   Download

The Requires

 

19/07 2018

v1.0.4

1.0.4.0

  Sources   Download

The Requires

 

18/07 2018

v1.0.3

1.0.3.0

  Sources   Download

The Requires

 

16/07 2018

v1.0.2

1.0.2.0

  Sources   Download

The Requires

 

06/09 2017

1.0.0

1.0.0.0

  Sources   Download