Skip to content

Commit

Permalink
Use Illuminate/Collections; upgrade PHP version
Browse files Browse the repository at this point in the history
  • Loading branch information
breadthe committed Feb 20, 2021
1 parent dcbc8d4 commit 9a6e641
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -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;}}}
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;}}}
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
46 changes: 19 additions & 27 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
</report>
</coverage>
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
</phpunit>
2 changes: 1 addition & 1 deletion src/TailwindColor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Breadthe\PhpContrast;

use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;

class TailwindColor implements Color
{
Expand Down
2 changes: 1 addition & 1 deletion tests/HexColorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion tests/TailwindTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 9a6e641

Please sign in to comment.