Skip to content

Drop TravisCI testing in favor of GitHub Actions, test up to PHP 8.0 #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 2, 2021
Merged
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
43 changes: 43 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -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
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
15 changes: 11 additions & 4 deletions tests/FontLib/FontTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Comment on lines +20 to +21
Copy link
Contributor

@enumag enumag Oct 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use expectNotToPerformAssertions() instead.
Although... not sure if it exists in old PHPUnit versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure in PHPUnit 4? Tests need to run on PHP 5.4 too.

}
}

public function testLoadTTFFontSuccessfully()
Expand Down