2017 © Pedro Peláez
 

library php-expose

Makes non-public properties and methods be testable to help your unit tests with PHPUnit.

image

suin/php-expose

Makes non-public properties and methods be testable to help your unit tests with PHPUnit.

  • Sunday, September 16, 2012
  • by suin
  • Repository
  • 1 Watchers
  • 5 Stars
  • 1,252 Installations
  • PHP
  • 11 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

Expose

Expose makes non-public properties and methods be testable to help your unit tests with PHPUnit., (*1)

The build status of the current master branch is tracked by Travis CI: Build Status, (*2)

<?php
use \Expose\Expose as e;

class Object
{
    private $_secret;
    protected $_protected;

    private function _hello($world = 'World')
    {
        return sprintf('Hello, %s', $world);
    }
}

$object = new Object();

// Expose non-public properties
e::expose($object)
    ->attr('_secret', 'foo')
    ->attr('_protected', 'bar');

// Call non-public method
$result = e::expose($object)->call('_hello', 'Suin');

Requirements

  • PHP 5.3 or later

Installation

Just git-clone or inntall via composer., (*3)

composer.json:, (*4)

{
    "require": {
        "suin/php-expose": ">=1.0"
    }
}

Inclue vendor/autoload.php in your bootstrap.php of PHPUnit to load Expose components:, (*5)

require_once 'vendor/autoload.php';

License

MIT License, (*6)

The Versions

16/09 2012

dev-master

9999999-dev https://github.com/suin/php-expose

Makes non-public properties and methods be testable to help your unit tests with PHPUnit.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

phpunit unittest testable expose

16/09 2012

1.0

1.0.0.0 https://github.com/suin/php-expose

Makes non-public properties and methods be testable to help your unit tests with PHPUnit.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

phpunit unittest testable expose