diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 0000000..07ab03f --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,43 @@ +name: PHPUnit tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + php-version: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php-version: + - "5.4" + - "5.5" + - "5.6" + - "7.0" + - "7.1" + - "7.2" + - "7.3" + - "7.4" + - "8.0" + + steps: + + - uses: actions/checkout@v2 + + - name: Install PHP + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + coverage: "none" + ini-values: "zend.assertions=1" + + - name: Install Composer dependencies + run: composer install --no-progress --ansi + + - name: Run tests ${{ matrix.php-version }} + run: SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 bin/simple-phpunit --color=always diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a38c93e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -language: php - -env: - - PREFER_LOWEST="--prefer-lowest" - - PREFER_LOWEST="" - -php: - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - - 7.4 - - nightly - -matrix: - include: - - php: 5.4 - dist: trusty - - php: 5.5 - dist: trusty - allow_failures: - - php: nightly - fast_finish: true - -before_script: - - composer dump-autoload - - composer self-update - - composer update --prefer-source $PREFER_LOWEST - -script: bin/phpunit - - -# Use Travis' new container-based infrastructure. -# See http://docs.travis-ci.com/user/migrating-from-legacy/#How-can-I-use-container-based-infrastructure%3F -sudo: false diff --git a/README.md b/README.md index f166ced..002e2ed 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # PHP Font Lib -[![Build Status](https://travis-ci.org/PhenX/php-font-lib.svg?branch=master)](https://travis-ci.org/PhenX/php-font-lib) - - This library can be used to: * Read TrueType, OpenType (with TrueType glyphs), WOFF font files * Extract basic info (name, style, etc) diff --git a/composer.json b/composer.json index 18cf0ca..19df7e4 100644 --- a/composer.json +++ b/composer.json @@ -16,9 +16,9 @@ } }, "config": { - "bin-dir": "bin" + "bin-dir": "bin" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5 || ^6 || ^7" + "symfony/phpunit-bridge" : "^3 || ^4 || ^5" } } diff --git a/tests/FontLib/FontTest.php b/tests/FontLib/FontTest.php index b998a49..5d2277e 100644 --- a/tests/FontLib/FontTest.php +++ b/tests/FontLib/FontTest.php @@ -7,12 +7,19 @@ class FontTest extends TestCase { - /** - * @expectedException \Fontlib\Exception\FontNotFoundException - */ public function testLoadFileNotFound() { - Font::load('non-existing/font.ttf'); + // @todo when PHP 5.4 support is dropped, uncomment line below and drop + // the try...catch block. + // $this->expectException('\Fontlib\Exception\FontNotFoundException'); + try { + Font::load('non-existing/font.ttf'); + $this->fail('Load should have failed.'); + } + catch (\Fontlib\Exception\FontNotFoundException $e) { + // Avoid throwing a risky test error. + $this->assertTrue(true); + } } public function testLoadTTFFontSuccessfully()