Is it possible using Laravel mocking, stubling, (and/or Codeception\Test\Unit and/or Codeception\Stub) to make test for method z (public testZ(){...} ) for following class:
<?php
class X extends Y
{
public function z(string $c = 'c') : array
{
return [$c, time()];
}
}
So, I need time() to return fake value. Uopz & mimus are excluded options (coz it is possible that sooner or later it can be abandoned).
Is there any Laravel/php trick to make reliable test for codes that returns time() as part of returned value?