reset() публичный статический Метод

Clears the registered hash.
public static reset ( )
Пример #1
0
 /**
  * Clears the registered references & logs.
  */
 public static function reset()
 {
     static::$_logs = [];
     static::$_index = 0;
     Suite::reset();
 }
Пример #2
0
 /**
  * Clears the registered references.
  *
  * @param string $reference An instance or a fully namespaced class name or `null` to clear all.
  */
 public static function reset($reference = null)
 {
     if ($reference === null) {
         static::$_registered = [];
         Suite::reset();
         return;
     }
     unset(static::$_registered[Suite::hash($reference)]);
 }
Пример #3
0
     });
 });
 describe("::register()", function () {
     it("return `false` if the hash is not registered", function () {
         $instance = new stdClass();
         $hash = Suite::hash($instance);
         expect(Suite::registered($hash))->toBe(false);
     });
 });
 describe("::reset()", function () {
     it("clears registered hashes", function () {
         $instance = new stdClass();
         $hash = Suite::hash($instance);
         Suite::register($hash);
         expect(Suite::registered($hash))->toBe(true);
         Suite::reset();
         expect(Suite::registered($hash))->toBe(false);
     });
 });
 describe("->status()", function () {
     it("returns `0` if a specs suite passes", function () {
         $describe = $this->suite->describe("", function () {
             $this->it("passes", function () {
                 $this->expect(true)->toBe(true);
             });
         });
         $this->suite->run();
         expect($this->suite->status())->toBe(0);
     });
     it("returns `-1` if a specs suite fails", function () {
         $describe = $this->suite->describe("", function () {