Skip to content

Commit

Permalink
Merge pull request #3 from dekiakbar/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Deki Akbar authored Mar 22, 2021
2 parents 96d6e5f + bca6cb9 commit 8b1b8cc
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions tests/RegionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ protected function tearDown(): void
public function testgetAllProvinceBps()
{
$response = $this->region->getAllProvince('bps');
if(is_array($response->detail)){
if (is_array($response->detail)) {
foreach ($response->detail as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
break;
}
}
if(is_array($response->list)){
if (is_array($response->list)) {
foreach ($response->list as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
Expand All @@ -41,7 +41,7 @@ public function testgetAllProvinceBps()
public function testgetAllProvinceDagri()
{
$response = $this->region->getAllProvince('dagri');
if(is_array($response->detail)){
if (is_array($response->detail)) {
foreach ($response->detail as $data) {
$this->assertObjectHasAttribute('kode_bps', $data);
$this->assertObjectHasAttribute('nama_bps', $data);
Expand All @@ -50,7 +50,7 @@ public function testgetAllProvinceDagri()
break;
}
}
if(is_array($response->list)){
if (is_array($response->list)) {
foreach ($response->list as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
Expand All @@ -62,7 +62,7 @@ public function testgetAllProvinceDagri()
public function testgetAllProvincePos()
{
$response = $this->region->getAllProvince('pos');
if(is_array($response->detail)){
if (is_array($response->detail)) {
foreach ($response->detail as $data) {
$this->assertObjectHasAttribute('kode_bps', $data);
$this->assertObjectHasAttribute('nama_bps', $data);
Expand All @@ -71,7 +71,7 @@ public function testgetAllProvincePos()
break;
}
}
if(is_array($response->list)){
if (is_array($response->list)) {
foreach ($response->list as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
Expand All @@ -85,14 +85,14 @@ public function testgetCityListByProvinceIdBps()
$provinceIds = [11];
foreach ($provinceIds as $provinceId) {
$cities = $this->region->getCityListByProvinceId('bps', $provinceId);
if(is_array($cities->list)){
if (is_array($cities->list)) {
foreach ($cities->list as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
break;
}
}
if(is_array($cities->detail)){
if (is_array($cities->detail)) {
foreach ($cities->detail as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
Expand All @@ -107,7 +107,7 @@ public function testgetCityListByProvinceIdDagri()
$provinceIds = [63];
foreach ($provinceIds as $provinceId) {
$cities = $this->region->getCityListByProvinceId('dagri', $provinceId);
if(is_array($cities->detail)){
if (is_array($cities->detail)) {
foreach ($cities->detail as $data) {
$this->assertObjectHasAttribute('kode_bps', $data);
$this->assertObjectHasAttribute('nama_bps', $data);
Expand All @@ -116,7 +116,7 @@ public function testgetCityListByProvinceIdDagri()
break;
}
}
if(is_array($cities->list)){
if (is_array($cities->list)) {
foreach ($cities->list as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
Expand All @@ -131,7 +131,7 @@ public function testgetCityListByProvinceIdPos()
$provinceIds = [61];
foreach ($provinceIds as $provinceId) {
$cities = $this->region->getCityListByProvinceId('pos', $provinceId);
if(is_array($cities->detail)){
if (is_array($cities->detail)) {
foreach ($cities->detail as $data) {
$this->assertObjectHasAttribute('kode_bps', $data);
$this->assertObjectHasAttribute('nama_bps', $data);
Expand All @@ -140,7 +140,7 @@ public function testgetCityListByProvinceIdPos()
break;
}
}
if(is_array($cities->list)){
if (is_array($cities->list)) {
foreach ($cities->list as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
Expand All @@ -155,14 +155,14 @@ public function testgetSubdistrictListByCityIdBps()
$cityIds = [3278];
foreach ($cityIds as $cityId) {
$subdistricts = $this->region->getSubdistrictListByCityId('bps', $cityId);
if(is_array($subdistricts->list)){
if (is_array($subdistricts->list)) {
foreach ($subdistricts->list as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
break;
}
}
if(is_array($subdistricts->detail)){
if (is_array($subdistricts->detail)) {
foreach ($subdistricts->detail as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
Expand All @@ -177,7 +177,7 @@ public function testgetSubdistrictListByCityIdDagri()
$cityIds = ['32.78'];
foreach ($cityIds as $cityId) {
$subdistricts = $this->region->getSubdistrictListByCityId('dagri', $cityId);
if(is_array($subdistricts->detail)){
if (is_array($subdistricts->detail)) {
foreach ($subdistricts->detail as $data) {
$this->assertObjectHasAttribute('kode_bps', $data);
$this->assertObjectHasAttribute('nama_bps', $data);
Expand All @@ -186,7 +186,7 @@ public function testgetSubdistrictListByCityIdDagri()
break;
}
}
if(is_array($subdistricts->list)){
if (is_array($subdistricts->list)) {
foreach ($subdistricts->list as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
Expand All @@ -201,7 +201,7 @@ public function testgetSubdistrictListByCityIdPos()
$cityIds = [3272];
foreach ($cityIds as $cityId) {
$subdistricts = $this->region->getSubdistrictListByCityId('pos', $cityId);
if(is_array($subdistricts->detail)){
if (is_array($subdistricts->detail)) {
foreach ($subdistricts->detail as $data) {
$this->assertObjectHasAttribute('kode_bps', $data);
$this->assertObjectHasAttribute('nama_bps', $data);
Expand All @@ -210,7 +210,7 @@ public function testgetSubdistrictListByCityIdPos()
break;
}
}
if(is_array($subdistricts->list)){
if (is_array($subdistricts->list)) {
foreach ($subdistricts->list as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
Expand All @@ -225,14 +225,14 @@ public function testgetVillageListBySubdistrictIdBps()
$subdistricIds = [340302];
foreach ($subdistricIds as $subdistricId) {
$villages = $this->region->getVillageListBySubdistrictId('bps', $subdistricId);
if(is_array($villages->detail)){
if (is_array($villages->detail)) {
foreach ($villages->detail as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
break;
}
}
if(is_array($villages->list)){
if (is_array($villages->list)) {
foreach ($villages->list as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
Expand All @@ -247,7 +247,7 @@ public function testgetVillageListBySubdistrictIdDagri()
$subdistricIds = ['34.03.02'];
foreach ($subdistricIds as $subdistricId) {
$villages = $this->region->getVillageListBySubdistrictId('dagri', $subdistricId);
if(is_array($villages->detail)){
if (is_array($villages->detail)) {
foreach ($villages->detail as $data) {
$this->assertObjectHasAttribute('kode_bps', $data);
$this->assertObjectHasAttribute('nama_bps', $data);
Expand All @@ -264,7 +264,7 @@ public function testgetVillageListBySubdistrictIdPos()
$subdistricIds = [327203];
foreach ($subdistricIds as $subdistricId) {
$villages = $this->region->getVillageListBySubdistrictId('pos', $subdistricId);
if(is_array($villages->detail)){
if (is_array($villages->detail)) {
foreach ($villages->detail as $data) {
$this->assertObjectHasAttribute('kode_bps', $data);
$this->assertObjectHasAttribute('nama_bps', $data);
Expand All @@ -273,7 +273,7 @@ public function testgetVillageListBySubdistrictIdPos()
break;
}
}
if(is_array($villages->list)){
if (is_array($villages->list)) {
foreach ($villages->list as $data) {
$this->assertObjectHasAttribute('kode', $data);
$this->assertObjectHasAttribute('nama', $data);
Expand Down

0 comments on commit 8b1b8cc

Please sign in to comment.