From 314360d2a08d3be0ced35118bf6d2b7647a80e6b Mon Sep 17 00:00:00 2001 From: Lucas Nepomuceno Date: Wed, 8 Feb 2023 17:11:28 -0300 Subject: [PATCH 1/2] build: adds support for laravel 10.x and php 8.2 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index a6d7905..d9e7051 100644 --- a/composer.json +++ b/composer.json @@ -16,12 +16,12 @@ } ], "require": { - "php": "^8.1", + "php": "^8.1 || ^8.2", "ext-json": "*", "ext-fileinfo": "*", "ext-mbstring": "*", - "illuminate/support": "^9", - "illuminate/http": "^9", + "illuminate/support": "^9 || ^10", + "illuminate/http": "^9 || ^10", "guzzlehttp/guzzle": "^7.5" }, "autoload": { From d465630fb40ed5e56a1e631313920c12aa9b6fe5 Mon Sep 17 00:00:00 2001 From: Lucas Nepomuceno Date: Wed, 8 Feb 2023 17:14:15 -0300 Subject: [PATCH 2/2] test: change assertObjectHasAttribute to assertArrayHasKey on unit tests --- tests/Feature/ApiCepProviderTest.php | 6 +++--- tests/Feature/BrasilApiV1ProviderTest.php | 6 +++--- tests/Feature/BrasilApiV2ProviderTest.php | 6 +++--- tests/Feature/CepLaProviderTest.php | 6 +++--- tests/Feature/OpenCepProviderTest.php | 6 +++--- tests/Feature/PagarmeCepProviderTest.php | 6 +++--- tests/Feature/PostomonCepProviderTest.php | 6 +++--- tests/Feature/ViaCepProviderTest.php | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/Feature/ApiCepProviderTest.php b/tests/Feature/ApiCepProviderTest.php index 8ab07cd..d3b0c20 100644 --- a/tests/Feature/ApiCepProviderTest.php +++ b/tests/Feature/ApiCepProviderTest.php @@ -37,7 +37,7 @@ public function testValidatesOriginalResponseStructure() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $originalProviderResponse); + $this->assertArrayHasKey($field, (array) $originalProviderResponse); } } @@ -60,12 +60,12 @@ public function testValidatesIfTheRequestWillBeExecutedSuccessfully() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } foreach ($optionalFields as $field) { $this->isNull($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } } diff --git a/tests/Feature/BrasilApiV1ProviderTest.php b/tests/Feature/BrasilApiV1ProviderTest.php index 144c57a..e7da22c 100644 --- a/tests/Feature/BrasilApiV1ProviderTest.php +++ b/tests/Feature/BrasilApiV1ProviderTest.php @@ -37,7 +37,7 @@ public function testValidatesOriginalResponseStructure() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $originalProviderResponse); + $this->assertArrayHasKey($field, (array) $originalProviderResponse); } } @@ -60,12 +60,12 @@ public function testValidatesIfTheRequestWillBeExecutedSuccessfully() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } foreach ($optionalFields as $field) { $this->isNull($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } } diff --git a/tests/Feature/BrasilApiV2ProviderTest.php b/tests/Feature/BrasilApiV2ProviderTest.php index 09eb7e4..39d73af 100644 --- a/tests/Feature/BrasilApiV2ProviderTest.php +++ b/tests/Feature/BrasilApiV2ProviderTest.php @@ -37,7 +37,7 @@ public function testValidatesOriginalResponseStructure() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $originalProviderResponse); + $this->assertArrayHasKey($field, (array) $originalProviderResponse); } } @@ -60,12 +60,12 @@ public function testValidatesIfTheRequestWillBeExecutedSuccessfully() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } foreach ($optionalFields as $field) { $this->isNull($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } } diff --git a/tests/Feature/CepLaProviderTest.php b/tests/Feature/CepLaProviderTest.php index a23a473..896462d 100644 --- a/tests/Feature/CepLaProviderTest.php +++ b/tests/Feature/CepLaProviderTest.php @@ -37,7 +37,7 @@ public function testValidatesOriginalResponseStructure() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $originalProviderResponse); + $this->assertArrayHasKey($field, (array) $originalProviderResponse); } } @@ -60,12 +60,12 @@ public function testValidatesIfTheRequestWillBeExecutedSuccessfully() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } foreach ($optionalFields as $field) { $this->isNull($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } } diff --git a/tests/Feature/OpenCepProviderTest.php b/tests/Feature/OpenCepProviderTest.php index 9a3d2b0..5c75052 100644 --- a/tests/Feature/OpenCepProviderTest.php +++ b/tests/Feature/OpenCepProviderTest.php @@ -37,7 +37,7 @@ public function testValidatesOriginalResponseStructure() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $originalProviderResponse); + $this->assertArrayHasKey($field, (array) $originalProviderResponse); } } @@ -60,12 +60,12 @@ public function testValidatesIfTheRequestWillBeExecutedSuccessfully() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } foreach ($optionalFields as $field) { $this->isNull($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } } diff --git a/tests/Feature/PagarmeCepProviderTest.php b/tests/Feature/PagarmeCepProviderTest.php index a672331..cbaa8b3 100644 --- a/tests/Feature/PagarmeCepProviderTest.php +++ b/tests/Feature/PagarmeCepProviderTest.php @@ -37,7 +37,7 @@ public function testValidatesOriginalResponseStructure() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $originalProviderResponse); + $this->assertArrayHasKey($field, (array) $originalProviderResponse); } } @@ -60,12 +60,12 @@ public function testValidatesIfTheRequestWillBeExecutedSuccessfully() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } foreach ($optionalFields as $field) { $this->isNull($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } } diff --git a/tests/Feature/PostomonCepProviderTest.php b/tests/Feature/PostomonCepProviderTest.php index b87456a..b8ba403 100644 --- a/tests/Feature/PostomonCepProviderTest.php +++ b/tests/Feature/PostomonCepProviderTest.php @@ -37,7 +37,7 @@ public function testValidatesOriginalResponseStructure() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $originalProviderResponse); + $this->assertArrayHasKey($field, (array) $originalProviderResponse); } } @@ -60,12 +60,12 @@ public function testValidatesIfTheRequestWillBeExecutedSuccessfully() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } foreach ($optionalFields as $field) { $this->isNull($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } } diff --git a/tests/Feature/ViaCepProviderTest.php b/tests/Feature/ViaCepProviderTest.php index 8b554ac..27ee669 100644 --- a/tests/Feature/ViaCepProviderTest.php +++ b/tests/Feature/ViaCepProviderTest.php @@ -37,7 +37,7 @@ public function testValidatesOriginalResponseStructure() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $originalProviderResponse); + $this->assertArrayHasKey($field, (array) $originalProviderResponse); } } @@ -60,12 +60,12 @@ public function testValidatesIfTheRequestWillBeExecutedSuccessfully() foreach ($requiredFields as $field) { $this->assertNotEmpty($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } foreach ($optionalFields as $field) { $this->isNull($field); - $this->assertObjectHasAttribute($field, $response); + $this->assertArrayHasKey($field, (array) $response); } }