phpmock\Mock::disable PHP Method

disable() public method

Disable this mock.
See also: Mock::enable()
See also: Mock::disableAll()
public disable ( )
    public function disable()
    {
        MockRegistry::getInstance()->unregister($this);
    }

Usage Example

Example #1
1
 /**
  * Tests the example from the documentation.
  *
  * @expectedException Exception
  */
 public function testExample4()
 {
     $function = function () {
         throw new \Exception();
     };
     $mock = new Mock(__NAMESPACE__, "time", $function);
     $mock->enable();
     try {
         time();
     } finally {
         $mock->disable();
     }
 }
All Usage Examples Of phpmock\Mock::disable