jstewmc/test-case

Access private properties in unit tests

v2.0.0 2017-07-04 20:16 UTC

This package is auto-updated.

Last update: 2024-10-29 04:58:49 UTC


README

Access private properties in unit tests.

use Jstewmc\TestCase\TestCase;

class Test extends TestCase
{
    public function testFoo()
    {
        $class = new class { private $foo = 'bar'; };
        
        $this->assertEquals('bar', $this->getProperty('foo', $class));
        
        return;
    }    
}

License

MIT

Author

Jack Clayton

Version

2.0.0, July 4, 2017

  • Update PHPUnit's major version from ^5.4 to ^6.2.

1.0.0, August 13, 2016

  • Stable release

0.1.0, July 28, 2016

  • Initial release