1. Go to this page and download the library: Download i3bepb/reflection-for-test library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
i3bepb / reflection-for-test example snippets
use I3bepb\ReflectionForTest\AccessToMethod;
use PHPUnit\Framework\TestCase;
class AnyTest extends TestCase
{
use AccessToMethod;
/**
* Any test.
*
* @test
*
* @throws \ReflectionException
*/
public function any_test()
{
$object = new ClassWithPrivateMethod();
// In $resultPrivateMethod result after call private method
$resultPrivateMethod = $this->privateMethodWithParameters($object, 'privateMethod', ['abc', 123]);
// Any test...
}