diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..1ba71e6 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,35 @@ +name: Tests + +on: [push, pull_request] + +jobs: + tests: + name: Tests PHP ${{ matrix.php }} + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental }} + strategy: + fail-fast: false + matrix: + php: [7.3, 7.4, 8.0] + experimental: [false] + include: + - php: 7.4 + analysis: true + - php: 8.1 + experimental: true + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up PHP ${{ matrix.php }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + + - name: Install dependencies with Composer + uses: ramsey/composer-install@v1 + + - name: Tests + run: composer test \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100755 index 58f7322..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - -script: phpunit diff --git a/README.md b/README.md index c1801f2..ae0eb8f 100755 --- a/README.md +++ b/README.md @@ -7,7 +7,13 @@ Splits stylesheets that go beyond the IE limit of 4096 selectors. See this [MSDN ## Installation -Use composer +It's recommended to use [Composer](https://getcomposer.org) to install + +```bash +$ composer require dlundgren/php-css-splitter +``` + +This will install the CssSplitter library and any required dependencies. ## Usage @@ -32,11 +38,10 @@ if($additional_part_count > 0) { file_put_contents('styles_'. $part .'.css', $splitter->split($css, $part)); } } - - ``` + ## Credits & License Original inspiration came from the Ruby gem [CssSplitter](https://github.com/zweilove/css_splitter). -Uses the MIT license. +CssSplitter is licensed under the MIT license. See [License File](LICENSE) for more information. \ No newline at end of file diff --git a/composer.json b/composer.json old mode 100755 new mode 100644 index 706dd62..3092ac0 --- a/composer.json +++ b/composer.json @@ -19,9 +19,12 @@ } }, "require" : { - "php" : ">=5.3.0" + "php" : ">=7.3" }, "require-dev" : { - "phpunit/phpunit" : "3.7.*" + "phpunit/phpunit" : "^9.0" + }, + "scripts": { + "test": "phpunit" } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0ca6553..d91e770 100755 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,23 +1,22 @@ + + + ./src + + ./tests/Tests - - - ./src/ - - diff --git a/tests/Tests/SplitterTest.php b/tests/Tests/SplitterTest.php index 25ec8f3..f46981a 100755 --- a/tests/Tests/SplitterTest.php +++ b/tests/Tests/SplitterTest.php @@ -11,9 +11,10 @@ namespace CssSplitter\Tests; use CssSplitter\Splitter; +use PHPUnit\Framework\TestCase; class SplitterTest - extends \PHPUnit_Framework_TestCase + extends TestCase { public static function provideSplitFilesAndExpectedResults() {