Behat\RestTestingContext\BaseContext::setRestContext PHP Method

setRestContext() public static method

public static setRestContext ( RestContext $restContext ) : void
$restContext RestContext
return void
    public static function setRestContext(RestContext $restContext)
    {
        self::$restContext = $restContext;
    }

Usage Example

 /**
  * Initializes provided context.
  *
  * @param Context $context
  * @return void
  */
 public function initializeContext(Context $context)
 {
     if ($context instanceof WebApiContext) {
         BaseContext::setWebApiContext($context);
     } elseif ($context instanceof RestContext) {
         BaseContext::setRestContext($context);
     }
 }