Skip to content

v1.1

Compare
Choose a tag to compare
@Spamercz Spamercz released this 08 Feb 12:06
· 7 commits to master since this release
  • New function allowing to call private method on object.

Example:

class TestClass
{
    private function saltPassword($string)
    {
        return $string . 'salt';
    }
}

Test result:

$testClass = new TestClass();

$result = \Spamer\DependencyMocker\Mocker::callPrivateFunction($testClass, 'saltPassword', ['string']);

\Tester\Assert::same('stringsalt', $result);