/** * @test */ public function it_gets_a_country_resource() { $wps = new Sdk(); $wps->addMockResults([new Response(200, [], json_encode($wps->countryResponse(1)))]); $country = $wps->country()->find(1); $this->assertEquals(['/countries/1/'], $wps->getRequestUris()); $this->assertInstanceOf(Country::class, $country); $this->assertEquals([$wps->tagResponse(1)['data']['id'], $wps->countryResponse(1)['data']['name']], [$country->id, $country->name]); }
/** * @test */ public function it_gets_a_feature_resource() { $wps = new Sdk(); $wps->addMockResults([new Response(200, [], json_encode($wps->featureResponse(1)))]); $feature = $wps->feature()->find(1); $this->assertEquals(['/features/1/'], $wps->getRequestUris()); $this->assertInstanceOf(Feature::class, $feature); $this->assertEquals([$wps->tagResponse(1)['data']['id'], $wps->featureResponse(1)['data']['name']], [$feature->id, $feature->name]); }
/** * @test */ public function it_gets_a_block_resource() { $wps = new Sdk(); $wps->addMockResults([new Response(200, [], json_encode($wps->blockResponse(1)))]); $block = $wps->block()->find(1); $this->assertEquals(['/blocks/1/'], $wps->getRequestUris()); $this->assertInstanceOf(Block::class, $block); $this->assertEquals([$wps->tagResponse(1)['data']['id'], $wps->blockResponse(1)['data']['data']], [$block->id, $block->data]); }