2017 © Pedro Peláez
 

library scrut

Injectable test classes for PHP.

image

watoki/scrut

Injectable test classes for PHP.

  • Saturday, July 25, 2015
  • by rtens
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3,773 Installations
  • PHP
  • 11 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

scrut Build Status

Have you ever thought how nice it would be to use dependency injection in your test classes? Search no further! scrut uses [factory] to inject it's properties. Just extend from Specification (which extends PHPUnit's TestCase) and define its dependencies by marking injectable properties with <-., (*1)

/**
 * @property DependencyOne one <-
 * @property NotInjected not (because to arrow)
 */
class MyTest extends Specification {

    /** @var DependencyTwo <- **/
    public $two;

    function testSomething() {
        $this->one->createSomeTestContext();
        $this->two->doSomething();
        $this->assertTrue($this->one->everythingIsCool());
    }
}

scrut can be used to create maintainable test suites which can also serve quite nicely as living documentation which then can be published (with dox for example)., (*2)

The Versions

25/07 2015

dev-master

9999999-dev http://github.com/watoki/scrut

Injectable test classes for PHP.

  Sources   Download

MIT

The Requires

 

test watoki sbe living documentation

12/05 2015

v0.3

0.3.0.0 http://github.com/watoki/scrut

Injectable test classes for PHP.

  Sources   Download

MIT

The Requires

 

test watoki sbe living documentation

14/11 2013

v0.2

0.2.0.0 http://github.com/watoki/scrut

Live documentation web application for PHP.

  Sources   Download

MIT

The Requires

 

test watoki sbe living documentation