Ejemplo n.º 1
0
 /**
  * Adds a new RequestMatcher callback.
  *
  * @param string $name Name of the RequestMatcher.
  * @param callable $callback A callback taking two Request objects as parameters and returns true if those match.
  *
  * @return Configuration
  * @throws VCRException If specified parameters are invalid.
  */
 public function addRequestMatcher($name, $callback)
 {
     Assertion::minLength($name, 1, "A request matchers name must be at least one character long. Found '{$name}'");
     Assertion::isCallable($callback, "Request matcher '{$name}' is not callable.");
     $this->availableRequestMatchers[$name] = $callback;
     return $this;
 }