Example #1
0
 /**
  * Tear down after test
  */
 protected function tearDown()
 {
     \Magelight\Forgery\MockContainer::getInstance()->reset();
 }
Example #2
0
 /**
  * Forge singleton instance
  *
  * @return Object
  */
 public static function getInstance()
 {
     static $instance;
     $className = get_called_class();
     $object = \Magelight\Forgery\MockContainer::getInstance()->getMock($className);
     if ($object instanceof $className) {
         return $object;
     }
     if (!$instance instanceof $className) {
         $instance = call_user_func_array([$className, 'forge'], func_get_args());
     }
     return $instance;
 }