2017 © Pedro Peláez
 

library phpunit-helpers

PHPUnit Helpers

image

rootwork/phpunit-helpers

PHPUnit Helpers

  • Friday, October 6, 2017
  • by rootwork
  • Repository
  • 3 Watchers
  • 2 Stars
  • 104 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 21 % Grown

The README.md

PHPUnit Helpers

Helper traits for PHPUnit, (*1)

"You can touch your privates and you can touch your friends' privates but you can't touch your parents' privates... unless they're protected." -Unknown, (*2)

Installation

Install composer in a common location or in your project:, (*3)

curl -s http://getcomposer.org/installer | php

Create the composer.json file as follows:, (*4)

{
    "require": {
        "rootwork/phpunit-helpers": "dev-master"
    }
}

Run the composer installer:, (*5)

php composer.phar install

Usage

namespace Test;

use Rootwork\PHPUnit\Helper\Accessor;

class MyTest extends \PHPUnit_Framework_TestCase
{
    use Accessor;

    public function testThings()
    {
        $sut = new MyThing();

        // Set a non-public property
        $this->setPropertyValue($sut, 'someNonPublicProperty', 'foo');

        // Get a non-public property
        $result = $this->getPropertyValue($sut, 'someNonPublicProperty'); // foo

        // Invoke a non-public method
        $this->invokeMethod($sut, 'someNonPublicMethod', ['foo', 'bar']);

        // Invoke a non-public method with arguments
        $this->invokeMethod($sut, 'someNonPublicMethod', ['foo', 'bar']);
    }
}

The Versions

06/10 2017

dev-master

9999999-dev https://github.com/rootworkit/phpunit-helpers

PHPUnit Helpers

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Mike Soule

phpunit rootwork

06/10 2017

dev-develop

dev-develop https://github.com/rootworkit/phpunit-helpers

PHPUnit Helpers

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Mike Soule

phpunit rootwork

27/06 2017

2.0.0

2.0.0.0 https://github.com/rootworkit/phpunit-helpers

PHPUnit Helpers

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Mike Soule

phpunit rootwork

09/02 2016

1.0.1

1.0.1.0 https://github.com/rootworkit/phpunit-helpers

PHPUnit Helpers

  Sources   Download

BSD-3-Clause

The Requires

 

by Mike Soule

phpunit rootwork

08/02 2016

1.0.0

1.0.0.0 https://github.com/rootworkit/phpunit-helpers

PHPUnit Helpers

  Sources   Download

BSD-3-Clause

The Requires

 

by Mike Soule

phpunit rootwork