Example #1
0
 /**
  *  it
  *
  *  Adds a test to current spec object and invokes test container.
  *
  *  @param string $testDescription
  *  @param callable $testContainer
  *
  *  @return void
  */
 public static function it(string $testDescription, callable $testContainer)
 {
     if (self::$currentSpec && array_key_exists(self::$currentSpec, self::$specs) === true) {
         self::$currentSpecInstance->it($testDescription, $testContainer);
         return call_user_func($testContainer);
     }
 }
Example #2
0
 /**
  *  register
  *
  *  Registers a spec test object.
  *
  *  @param \Cider\Spec\Spec $spec
  *
  *  @return void
  */
 public static function register(Spec $spec)
 {
     self::$specs[$spec->description()] = $spec;
     self::$numSpecs = count(self::$specs);
     self::$currentSpec = $spec->description();
     self::$currentSpecInstance = $spec;
 }