Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
7 changes: 5 additions & 2 deletions composer.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
15 changes: 7 additions & 8 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="tests/bootstrap.php"
stopOnFailure="true"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="CSS Splitter Tests">
<directory>./tests/Tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>./src/</directory>
</whitelist>
</filter>
</phpunit>
3 changes: 2 additions & 1 deletion tests/Tests/SplitterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down