uopz_unset_mock

(PECL uopz 5, PECL uopz 6)

uopz_unset_mockUnset previously set mock

説明

uopz_unset_mock ( string $class ) : void

Unsets the previously set mock for class.

パラメータ

class

The name of the mocked class.

エラー / 例外

A RuntimeException is thrown, if no mock was previously set for class.

例1 uopz_unset_mock() example

<?php
class {
    public static function 
who() {
        echo 
"A";
    }
}

class 
mockA {
    public static function 
who() {
        echo 
"mockA";
    }
}

uopz_set_mock(A::class, mockA::class);
uopz_unset_mock(A::class);
A::who();
?>

上の例の出力は以下となります。

A

参考