mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Rework tests structure. Upgrade codeception to 2.5.3. Merge params configuration into app configuration.
This commit is contained in:
24
common/tests/helpers/Mock.php
Normal file
24
common/tests/helpers/Mock.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace common\tests\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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user