2017 © Pedro Peláez
 

library test

A PHP library for improving unit testing.

image

phine/test

A PHP library for improving unit testing.

  • Tuesday, December 31, 2013
  • by kherge
  • Repository
  • 0 Watchers
  • 2 Stars
  • 1,384 Installations
  • PHP
  • 13 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Test

Build Status Coverage Status Latest Stable Version Total Downloads, (*1)

A PHP library for improving unit testing., (*2)

Usage

use Phine\Test\Method;
use Phine\Test\Property;
use Phine\Test\Temp;

class Example
{
    private static $isStatic = 'original';

    private $nonStatic = 'original';

    protected static function isStatic($arg)
    {
        return "Static: $arg";
    }

    protected function nonStatic($arg)
    {
        return "Non static: $arg";
    }
}

$example = new Example();

// retrieve hidden values
echo Property::get('Example', 'isStatic'); // "original"
echo Property::get($example, 'nonStatic'); // "original"

// change hidden values
Property::set('Example', 'isStatic', 'changed');
Property::set($example, 'nonStatic', 'changed');

echo Property::get('Example', 'isStatic'); // "changed"
echo Property::get($example, 'nonStatic'); // "changed"

// invoke hidden methods
echo Method::invoke('Example', 'isStatic', 123); // "Static: 123"
echo Method::invoke($example, 'nonStatic', 456); // "Non static: 456"

echo Method::invokeArgs('Example', 'isStatic', array(123)); // "Static: 123"
echo Method::invokeArgs($example, 'nonStatic', array(456)); // "Static: 456"

$temp = new Temp();

// create temporary paths
$dir = $temp->createDir();
$file = $temp->createFile();

// copy existing paths to temporary ones (names are preserved)
$dir = $temp->copyDir('/path/to/dir');
$file = $temp->copyFile('/path/to/file');

// purge all temporary paths
$temp->purgePaths();

Requirement

Installation

Via Composer:, (*3)

$ composer require "phine/test=~1.0"

Documentation

You can find the documentation in the docs/ directory., (*4)

License

This library is available under the MIT license., (*5)

The Versions

31/12 2013

dev-master

9999999-dev https://github.com/phine/lib-test

A PHP library for improving unit testing.

  Sources   Download

MIT

The Requires

 

The Development Requires

test unit

31/12 2013

1.0.1

1.0.1.0 https://github.com/phine/lib-test

A PHP library for improving unit testing.

  Sources   Download

MIT

The Requires

 

The Development Requires

test unit

16/10 2013

1.0.0

1.0.0.0 https://github.com/phine/lib-test

A PHP library for improving unit testing.

  Sources   Download

MIT

The Requires

 

The Development Requires

test unit