Пример #1
0
 public function testHydrateRelatedModelJson()
 {
     $json = __DIR__ . "/spec-model.json";
     $spore = \PHP_Spore\Spore::newFromJson($json);
     $cache = $spore->getCache();
     $this->assertEquals($cache->headers->Host, "httpbin.org");
 }
Пример #2
0
 protected function setUp()
 {
     $this->spore = \PHP_Spore\Spore::newFromArray(["base_url" => "https://httpbin.org", "methods" => ["get" => ["path" => "/get", "method" => "GET", "model" => HTTPBinResponse::class], "query_params" => ["path" => "/response-headers", "method" => "GET", "params" => ["limit" => ["required" => true]]], "post" => ["path" => "/post", "method" => "POST", "form-data" => ["name"], "model" => HTTPBinResponseWithPerson::class]]]);
 }