From 9a6e641336d452b3298e12ab6352083e175ba629 Mon Sep 17 00:00:00 2001 From: breadthe Date: Fri, 19 Feb 2021 20:04:39 -0600 Subject: [PATCH] Use Illuminate/Collections; upgrade PHP version --- .phpunit.result.cache | 2 +- composer.json | 6 +++--- phpunit.xml.dist | 46 +++++++++++++++++------------------------- src/TailwindColor.php | 2 +- tests/HexColorTest.php | 2 +- tests/TailwindTest.php | 2 +- 6 files changed, 26 insertions(+), 34 deletions(-) diff --git a/.phpunit.result.cache b/.phpunit.result.cache index f2bb06e..9a65393 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -C:30:"PHPUnit\Runner\TestResultCache":1802:{a:2:{s:7:"defects";a:7:{s:121:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_random_color_pairs_of_minimum_specified_ratio_but_no_less_than_3_to_1";i:3;s:111:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_the_correct_contrast_ratio with data set "maximum contrast"";i:4;s:123:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_the_correct_contrast_ratio with data set "no contrast - black on black"";i:4;s:123:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_the_correct_contrast_ratio with data set "no contrast - white on white"";i:4;s:108:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_the_correct_contrast_ratio with data set "high contrast"";i:4;s:107:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_the_correct_contrast_ratio with data set "low contrast"";i:4;s:94:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_random_color_pairs_of_minimum_3_to_1_ratio";i:3;}s:5:"times";a:7:{s:111:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_the_correct_contrast_ratio with data set "maximum contrast"";d:0.001;s:123:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_the_correct_contrast_ratio with data set "no contrast - black on black"";d:0;s:123:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_the_correct_contrast_ratio with data set "no contrast - white on white"";d:0;s:108:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_the_correct_contrast_ratio with data set "high contrast"";d:0;s:107:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_the_correct_contrast_ratio with data set "low contrast"";d:0;s:94:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_random_color_pairs_of_minimum_3_to_1_ratio";d:0;s:121:"Breadthe\PhpContrast\Tests\ContrastTest::it_returns_random_color_pairs_of_minimum_specified_ratio_but_no_less_than_3_to_1";d:0;}}} \ No newline at end of file +C:37:"PHPUnit\Runner\DefaultTestResultCache":1788:{a:2:{s:7:"defects";a:4:{s:78:"Breadthe\PhpContrast\Tests\TailwindTest::it_generates_the_correct_object_types";i:4;s:94:"Breadthe\PhpContrast\Tests\TailwindTest::it_returns_random_color_pairs_of_minimum_3_to_1_ratio";i:4;s:79:"Breadthe\PhpContrast\Tests\TailwindTest::it_can_merge_default_and_custom_colors";i:6;s:82:"Breadthe\PhpContrast\Tests\HexColorTest::a_random_hex_color_is_generated_correctly";i:6;}s:5:"times";a:12:{s:115:"Breadthe\PhpContrast\Tests\HexColorPairTest::it_returns_the_correct_contrast_ratio with data set "maximum contrast"";d:0.003;s:127:"Breadthe\PhpContrast\Tests\HexColorPairTest::it_returns_the_correct_contrast_ratio with data set "no contrast - black on black"";d:0;s:127:"Breadthe\PhpContrast\Tests\HexColorPairTest::it_returns_the_correct_contrast_ratio with data set "no contrast - white on white"";d:0;s:112:"Breadthe\PhpContrast\Tests\HexColorPairTest::it_returns_the_correct_contrast_ratio with data set "high contrast"";d:0;s:111:"Breadthe\PhpContrast\Tests\HexColorPairTest::it_returns_the_correct_contrast_ratio with data set "low contrast"";d:0;s:98:"Breadthe\PhpContrast\Tests\HexColorPairTest::it_returns_random_color_pairs_of_minimum_3_to_1_ratio";d:0.001;s:97:"Breadthe\PhpContrast\Tests\HexColorPairTest::a_sibling_of_minimum_contrast_is_generated_correctly";d:0;s:73:"Breadthe\PhpContrast\Tests\HexColorTest::a_hex_color_is_created_correctly";d:0;s:82:"Breadthe\PhpContrast\Tests\HexColorTest::a_random_hex_color_is_generated_correctly";d:0;s:78:"Breadthe\PhpContrast\Tests\TailwindTest::it_generates_the_correct_object_types";d:0.003;s:94:"Breadthe\PhpContrast\Tests\TailwindTest::it_returns_random_color_pairs_of_minimum_3_to_1_ratio";d:0.001;s:79:"Breadthe\PhpContrast\Tests\TailwindTest::it_can_merge_default_and_custom_colors";d:0.001;}}} \ No newline at end of file diff --git a/composer.json b/composer.json index 24c9ef5..70dbcd5 100644 --- a/composer.json +++ b/composer.json @@ -16,12 +16,12 @@ } ], "require": { - "php": "7.*", + "php": ">=7.3", "ext-json": "*", - "tightenco/collect": "^6.14" + "illuminate/collections": "^8" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^9.3.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 22fe879..067cd56 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,29 +1,21 @@ - - - - tests - - - - - src/ - - - - - - - - - + + + + src/ + + + + + + + + + + tests + + + + + diff --git a/src/TailwindColor.php b/src/TailwindColor.php index 4cc59b9..9bd3241 100644 --- a/src/TailwindColor.php +++ b/src/TailwindColor.php @@ -2,7 +2,7 @@ namespace Breadthe\PhpContrast; -use Tightenco\Collect\Support\Collection; +use Illuminate\Support\Collection; class TailwindColor implements Color { diff --git a/tests/HexColorTest.php b/tests/HexColorTest.php index d8102f8..400971d 100644 --- a/tests/HexColorTest.php +++ b/tests/HexColorTest.php @@ -37,7 +37,7 @@ public function a_random_hex_color_is_generated_correctly() { $randomHexColor = HexColor::random(); - self::assertRegExp('/^#[0-9a-f]{6}$/i', $randomHexColor->hex); + self::assertMatchesRegularExpression('/^#[0-9a-f]{6}$/i', $randomHexColor->hex); self::assertNull($randomHexColor->name); } } diff --git a/tests/TailwindTest.php b/tests/TailwindTest.php index 49fb480..d776dea 100644 --- a/tests/TailwindTest.php +++ b/tests/TailwindTest.php @@ -58,6 +58,6 @@ public function it_can_merge_default_and_custom_colors() $randomCustomPaletteElement = $customPalette[rand(0, count($customPalette) - 1)]; - self::assertContains($randomCustomPaletteElement, $colors, false, true, false); + self::assertContainsEquals($randomCustomPaletteElement, $colors, false); } }