2017 © Pedro Peláez
 

library testing-tools

Testing tools

image

ignaszak/testing-tools

Testing tools

  • Monday, April 17, 2017
  • by ignaszak
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 57 % Grown

The README.md

# ignaszak/testing-tools

This package provides tools for testing class via reflection., (*1)

Requirements

  • PHP >= 7.0.0
  • PHPUnit >= 6.0.0

Installation

composer require ignaszak/testing-tools

Usage

Get property value

<?php

use Ignaszak\TestingTools\Test;

Test::get('propertyName', $object);

Set property value

<?php

use Ignaszak\TestingTools\Test;

// Set value
Test::inject('propertyName', 'new value', $object);
// Get value
Test::get('propertyName', $object);

Call method

<?php

use Ignaszak\TestingTools\Test;

// Call method with args
Test::call('method', ['arg1', 'arg2'], $object);
// Call method wthout args
Test::call('method', null, $object);

Define tested class

You can set instance of tested class in Test::$object., (*2)

<?php

use Ignaszak\TestingTools\Test;

Test::$object = new Example();

// All these methods refers to `Example`
Test::inject('propertyName', 'new value');
Test::inject('propertyName'); // Set null
Test::get('propertyName');
Test::call('method');
Test::call('method', ['arg1', 'arg2']);

The Versions

17/04 2017

dev-master

9999999-dev

Testing tools

  Sources   Download

MIT

The Requires

 

by Tomasz Ignaszak

test phpunit tool

17/04 2017

v2.0.0

2.0.0.0

Testing tools

  Sources   Download

MIT

The Requires

 

by Tomasz Ignaszak

test phpunit tool

17/04 2017

v1.0.0

1.0.0.0

Testing tools

  Sources   Download

MIT

The Requires

 

by Tomasz Ignaszak

test phpunit tool