mirror of
https://github.com/elyby/accounts.git
synced 2024-12-26 15:10:22 +05:30
25 lines
579 B
PHP
25 lines
579 B
PHP
|
<?php
|
||
|
declare(strict_types=1);
|
||
|
namespace tests\codeception\common\helpers;
|
||
|
|
||
|
use phpmock\mockery\PHPMockery;
|
||
|
use ReflectionClass;
|
||
|
|
||
|
class Mock {
|
||
|
|
||
|
/**
|
||
|
* @param string $className
|
||
|
* @param string $function
|
||
|
*
|
||
|
* @return \Mockery\Expectation
|
||
|
*/
|
||
|
public static function func(string $className, string $function) {
|
||
|
return PHPMockery::mock(self::getClassNamespace($className), $function);
|
||
|
}
|
||
|
|
||
|
private static function getClassNamespace(string $className): string {
|
||
|
return (new ReflectionClass($className))->getNamespaceName();
|
||
|
}
|
||
|
|
||
|
}
|