Kraken\_Unit\Filesystem\Factory\AllFactoryTest::createFactory PHP Метод

createFactory() публичный Метод

public createFactory ( string $class, mixed[] $args = [], bool[] $replaces = [true, true] ) : FilesystemAdapterSimpleFactory | PHPUnit_Framework_MockObject_MockObject
$class string
$args mixed[]
$replaces bool[]
Результат Kraken\Filesystem\FilesystemAdapterSimpleFactory | PHPUnit_Framework_MockObject_MockObject
    public function createFactory($class, $args = [], $replaces = [true, true])
    {
        $methods = [];
        if ($replaces[0]) {
            $methods[] = 'getClient';
        }
        if ($replaces[1]) {
            $methods[] = 'getClass';
        }
        $args = $args ? [$args] : [];
        $mock = $this->getMock($class, $methods, $args);
        if ($replaces[0]) {
            $mock->expects($this->any())->method('getClient')->will($this->returnValue(FilesystemAdapterFactoryMock::class));
        }
        if ($replaces[1]) {
            $mock->expects($this->any())->method('getClass')->will($this->returnValue(FilesystemAdapterFactoryMock::class));
        }
        return $mock;
    }