From 81e8a4ee079c301c8241aa3d93a3822980b5acc8 Mon Sep 17 00:00:00 2001 From: Andre Sugai <2228791+asugai@users.noreply.github.com> Date: Mon, 23 Dec 2024 13:40:29 -0600 Subject: [PATCH 1/4] updated composer dependencies, fixed creation of dynamic property in tests --- .phpunit.result.cache | 1 + composer.json | 6 +++--- tests/DataTypes/BTCTest.php | 2 ++ tests/DataTypes/EmailTest.php | 2 ++ tests/DataTypes/SMSTest.php | 2 ++ tests/DataTypes/WiFiTest.php | 4 +++- tests/GeneratorTest.php | 2 +- 7 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 .phpunit.result.cache diff --git a/.phpunit.result.cache b/.phpunit.result.cache new file mode 100644 index 0000000..3ed82b7 --- /dev/null +++ b/.phpunit.result.cache @@ -0,0 +1 @@ +{"version":1,"defects":[],"times":{"BTCTest::test_it_generates_a_valid_btc_qrcode_with_an_address_and_amount":0.001,"BTCTest::test_it_generates_a_valid_btc_qrcode_with_an_address_amount_and_label":0,"BTCTest::test_it_generates_a_valid_btc_qrcode_with_an_address_amount_label_message_and_return_address":0,"EmailTest::test_it_generates_the_proper_format_when_only_an_email_address_is_supplied":0,"EmailTest::test_it_generates_the_proper_format_when_an_email_subject_and_body_are_supplied":0,"EmailTest::test_it_generates_the_proper_format_when_an_email_and_subject_are_supplied":0,"EmailTest::test_it_generates_the_proper_format_when_only_a_subject_is_provided":0,"EmailTest::test_it_throws_an_exception_when_an_invalid_email_is_given":0,"GeoTest::test_it_generates_the_proper_format_for_a_geo_coordinate":0,"PhoneNumberTest::test_it_generates_the_proper_format_for_calling_a_phone_number":0,"SMSTest::test_it_generates_a_proper_format_with_a_phone_number":0,"SMSTest::test_it_generate_a_proper_format_with_a_message":0,"SMSTest::test_it_generates_a_proper_format_with_a_phone_number_and_message":0,"WiFiTest::test_it_generates_a_proper_format_with_just_the_ssid":0,"WiFiTest::test_it_generates_a_proper_format_for_a_ssid_that_is_hidden":0,"WiFiTest::test_it_generates_a_proper_format_for_a_ssid_encryption_and_password":0,"WiFiTest::test_it_generates_a_proper_format_for_a_ssid_encryption_password_and_is_hidden":0,"GeneratorTest::test_chaining_is_possible":0.001,"GeneratorTest::test_size_is_passed_to_the_renderer":0,"GeneratorTest::test_format_sets_the_image_format":0,"GeneratorTest::test_an_exception_is_thrown_if_an_unsupported_format_is_used":0,"GeneratorTest::test_color_is_set":0,"GeneratorTest::test_background_color_is_set":0,"GeneratorTest::test_eye_color_is_set":0,"GeneratorTest::test_eye_color_throws_exception_with_number_greater_than_2":0,"GeneratorTest::test_eye_color_throws_exception_with_negative_number":0,"GeneratorTest::test_grandient_is_set":0,"GeneratorTest::test_eye_style_is_set":0,"GeneratorTest::test_invalid_eye_throws_an_exception":0,"GeneratorTest::test_style_is_set":0,"GeneratorTest::test_an_exception_is_thrown_for_an_invalid_style":0,"GeneratorTest::test_an_exception_is_thrown_for_a_number_over_1":0,"GeneratorTest::test_an_exception_is_thrown_for_a_number_under_0":0,"GeneratorTest::test_an_exception_is_thrown_for_1":0,"GeneratorTest::test_get_renderer_returns_renderer":0,"GeneratorTest::test_it_calls_a_valid_dynamic_method_and_generates_a_qrcode":0.01,"GeneratorTest::test_it_throws_an_exception_if_datatype_is_not_found":0,"GeneratorTest::test_generator_can_return_illuminate_support_htmlstring":0.006,"ImageMergeTest::test_it_merges_two_images_together_and_centers_it":0.027,"ImageMergeTest::test_it_throws_an_exception_when_percentage_is_greater_than_1":0.002,"ImageTest::test_it_loads_an_image_string_into_a_resource":0.017,"ImageTest::test_it_gets_the_correct_height":0,"ImageTest::test_it_gets_the_correct_width":0}} \ No newline at end of file diff --git a/composer.json b/composer.json index 8594a91..18750ba 100644 --- a/composer.json +++ b/composer.json @@ -11,13 +11,13 @@ } ], "require": { - "php": ">=7.2|^8.0", + "php": "^8.0", "ext-gd": "*", - "bacon/bacon-qr-code": "^2.0" + "bacon/bacon-qr-code": "^3.0" }, "require-dev": { "mockery/mockery": "~1", - "phpunit/phpunit": "~9" + "phpunit/phpunit": "~11.5" }, "suggest": { "ext-imagick": "Allows the generation of PNG QrCodes.", diff --git a/tests/DataTypes/BTCTest.php b/tests/DataTypes/BTCTest.php index 04b3e49..2b88021 100644 --- a/tests/DataTypes/BTCTest.php +++ b/tests/DataTypes/BTCTest.php @@ -5,6 +5,8 @@ class BTCTest extends TestCase { + private BTC $btc; + public function setUp(): void { $this->btc = new BTC(); diff --git a/tests/DataTypes/EmailTest.php b/tests/DataTypes/EmailTest.php index 17a6931..42e5631 100644 --- a/tests/DataTypes/EmailTest.php +++ b/tests/DataTypes/EmailTest.php @@ -5,6 +5,8 @@ class EmailTest extends TestCase { + private Email $email; + public function setUp(): void { $this->email = new Email(); diff --git a/tests/DataTypes/SMSTest.php b/tests/DataTypes/SMSTest.php index 42a6e43..d129a2f 100644 --- a/tests/DataTypes/SMSTest.php +++ b/tests/DataTypes/SMSTest.php @@ -5,6 +5,8 @@ class SMSTest extends TestCase { + private SMS $sms; + public function setUp(): void { $this->sms = new SMS(); diff --git a/tests/DataTypes/WiFiTest.php b/tests/DataTypes/WiFiTest.php index 246e1bf..b960a6c 100644 --- a/tests/DataTypes/WiFiTest.php +++ b/tests/DataTypes/WiFiTest.php @@ -5,9 +5,11 @@ class WiFiTest extends TestCase { + private WiFi $wifi; + public function setUp(): void { - $this->wifi = new Wifi(); + $this->wifi = new WiFi(); } public function test_it_generates_a_proper_format_with_just_the_ssid() diff --git a/tests/GeneratorTest.php b/tests/GeneratorTest.php index d0d75be..91536a2 100644 --- a/tests/GeneratorTest.php +++ b/tests/GeneratorTest.php @@ -197,7 +197,7 @@ public function test_get_renderer_returns_renderer() public function test_it_calls_a_valid_dynamic_method_and_generates_a_qrcode() { $result = (new Generator)->btc('1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa'); - $this->assertEquals("\n\n", $result); + $this->assertEquals("\n\n", $result); } public function test_it_throws_an_exception_if_datatype_is_not_found() From 473b398e7a4a4ab17b0398f3092d200f9742f91a Mon Sep 17 00:00:00 2001 From: Andre Sugai <2228791+asugai@users.noreply.github.com> Date: Mon, 23 Dec 2024 13:44:19 -0600 Subject: [PATCH 2/4] Delete .phpunit.result.cache --- .phpunit.result.cache | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .phpunit.result.cache diff --git a/.phpunit.result.cache b/.phpunit.result.cache deleted file mode 100644 index 3ed82b7..0000000 --- a/.phpunit.result.cache +++ /dev/null @@ -1 +0,0 @@ -{"version":1,"defects":[],"times":{"BTCTest::test_it_generates_a_valid_btc_qrcode_with_an_address_and_amount":0.001,"BTCTest::test_it_generates_a_valid_btc_qrcode_with_an_address_amount_and_label":0,"BTCTest::test_it_generates_a_valid_btc_qrcode_with_an_address_amount_label_message_and_return_address":0,"EmailTest::test_it_generates_the_proper_format_when_only_an_email_address_is_supplied":0,"EmailTest::test_it_generates_the_proper_format_when_an_email_subject_and_body_are_supplied":0,"EmailTest::test_it_generates_the_proper_format_when_an_email_and_subject_are_supplied":0,"EmailTest::test_it_generates_the_proper_format_when_only_a_subject_is_provided":0,"EmailTest::test_it_throws_an_exception_when_an_invalid_email_is_given":0,"GeoTest::test_it_generates_the_proper_format_for_a_geo_coordinate":0,"PhoneNumberTest::test_it_generates_the_proper_format_for_calling_a_phone_number":0,"SMSTest::test_it_generates_a_proper_format_with_a_phone_number":0,"SMSTest::test_it_generate_a_proper_format_with_a_message":0,"SMSTest::test_it_generates_a_proper_format_with_a_phone_number_and_message":0,"WiFiTest::test_it_generates_a_proper_format_with_just_the_ssid":0,"WiFiTest::test_it_generates_a_proper_format_for_a_ssid_that_is_hidden":0,"WiFiTest::test_it_generates_a_proper_format_for_a_ssid_encryption_and_password":0,"WiFiTest::test_it_generates_a_proper_format_for_a_ssid_encryption_password_and_is_hidden":0,"GeneratorTest::test_chaining_is_possible":0.001,"GeneratorTest::test_size_is_passed_to_the_renderer":0,"GeneratorTest::test_format_sets_the_image_format":0,"GeneratorTest::test_an_exception_is_thrown_if_an_unsupported_format_is_used":0,"GeneratorTest::test_color_is_set":0,"GeneratorTest::test_background_color_is_set":0,"GeneratorTest::test_eye_color_is_set":0,"GeneratorTest::test_eye_color_throws_exception_with_number_greater_than_2":0,"GeneratorTest::test_eye_color_throws_exception_with_negative_number":0,"GeneratorTest::test_grandient_is_set":0,"GeneratorTest::test_eye_style_is_set":0,"GeneratorTest::test_invalid_eye_throws_an_exception":0,"GeneratorTest::test_style_is_set":0,"GeneratorTest::test_an_exception_is_thrown_for_an_invalid_style":0,"GeneratorTest::test_an_exception_is_thrown_for_a_number_over_1":0,"GeneratorTest::test_an_exception_is_thrown_for_a_number_under_0":0,"GeneratorTest::test_an_exception_is_thrown_for_1":0,"GeneratorTest::test_get_renderer_returns_renderer":0,"GeneratorTest::test_it_calls_a_valid_dynamic_method_and_generates_a_qrcode":0.01,"GeneratorTest::test_it_throws_an_exception_if_datatype_is_not_found":0,"GeneratorTest::test_generator_can_return_illuminate_support_htmlstring":0.006,"ImageMergeTest::test_it_merges_two_images_together_and_centers_it":0.027,"ImageMergeTest::test_it_throws_an_exception_when_percentage_is_greater_than_1":0.002,"ImageTest::test_it_loads_an_image_string_into_a_resource":0.017,"ImageTest::test_it_gets_the_correct_height":0,"ImageTest::test_it_gets_the_correct_width":0}} \ No newline at end of file From e6f97cfaa35268b5536a73fe328eb35778988d1e Mon Sep 17 00:00:00 2001 From: Andre Sugai <2228791+asugai@users.noreply.github.com> Date: Mon, 23 Dec 2024 13:50:43 -0600 Subject: [PATCH 3/4] updated spacing to match style reqs --- tests/DataTypes/BTCTest.php | 4 ++-- tests/DataTypes/WiFiTest.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/DataTypes/BTCTest.php b/tests/DataTypes/BTCTest.php index 2b88021..2613ef3 100644 --- a/tests/DataTypes/BTCTest.php +++ b/tests/DataTypes/BTCTest.php @@ -36,8 +36,8 @@ public function test_it_generates_a_valid_btc_qrcode_with_an_address_amount_labe 'btcaddress', 0.0034, [ - 'label' => 'label', - 'message' => 'message', + 'label' => 'label', + 'message' => 'message', 'returnAddress' => 'https://www.returnaddress.com', ], ]); diff --git a/tests/DataTypes/WiFiTest.php b/tests/DataTypes/WiFiTest.php index b960a6c..725a102 100644 --- a/tests/DataTypes/WiFiTest.php +++ b/tests/DataTypes/WiFiTest.php @@ -29,7 +29,7 @@ public function test_it_generates_a_proper_format_for_a_ssid_that_is_hidden() { $this->wifi->create([ 0 => [ - 'ssid' => 'foo', + 'ssid' => 'foo', 'hidden' => 'true', ], ]); @@ -43,7 +43,7 @@ public function test_it_generates_a_proper_format_for_a_ssid_encryption_and_pass { $this->wifi->create([ 0 => [ - 'ssid' => 'foo', + 'ssid' => 'foo', 'encryption' => 'WPA', 'password' => 'bar', ], @@ -58,10 +58,10 @@ public function test_it_generates_a_proper_format_for_a_ssid_encryption_password { $this->wifi->create([ 0 => [ - 'ssid' => 'foo', + 'ssid' => 'foo', 'encryption' => 'WPA', - 'password' => 'bar', - 'hidden' => 'true', + 'password' => 'bar', + 'hidden' => 'true', ], ]); From 8f0b211fc950d6530d901eaec5da5fbd282ee739 Mon Sep 17 00:00:00 2001 From: Andre Sugai <2228791+asugai@users.noreply.github.com> Date: Mon, 23 Dec 2024 13:51:15 -0600 Subject: [PATCH 4/4] more spacing fixes --- tests/DataTypes/WiFiTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DataTypes/WiFiTest.php b/tests/DataTypes/WiFiTest.php index 725a102..8735b76 100644 --- a/tests/DataTypes/WiFiTest.php +++ b/tests/DataTypes/WiFiTest.php @@ -45,7 +45,7 @@ public function test_it_generates_a_proper_format_for_a_ssid_encryption_and_pass 0 => [ 'ssid' => 'foo', 'encryption' => 'WPA', - 'password' => 'bar', + 'password' => 'bar', ], ]);