Skip to content

Commit ca5cf43

Browse files
authored
Drop TravisCI testing in favor of GitHub Actions, test up to PHP 8.0 (#94)
1 parent b5737cf commit ca5cf43

File tree

5 files changed

+56
-45
lines changed

5 files changed

+56
-45
lines changed

.github/workflows/phpunit.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: PHPUnit tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
php-version:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php-version:
18+
- "5.4"
19+
- "5.5"
20+
- "5.6"
21+
- "7.0"
22+
- "7.1"
23+
- "7.2"
24+
- "7.3"
25+
- "7.4"
26+
- "8.0"
27+
28+
steps:
29+
30+
- uses: actions/checkout@v2
31+
32+
- name: Install PHP
33+
uses: "shivammathur/setup-php@v2"
34+
with:
35+
php-version: "${{ matrix.php-version }}"
36+
coverage: "none"
37+
ini-values: "zend.assertions=1"
38+
39+
- name: Install Composer dependencies
40+
run: composer install --no-progress --ansi
41+
42+
- name: Run tests ${{ matrix.php-version }}
43+
run: SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 bin/simple-phpunit --color=always

.travis.yml

-36
This file was deleted.

README.md

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# PHP Font Lib
22

3-
[![Build Status](https://travis-ci.org/PhenX/php-font-lib.svg?branch=master)](https://travis-ci.org/PhenX/php-font-lib)
4-
5-
63
This library can be used to:
74
* Read TrueType, OpenType (with TrueType glyphs), WOFF font files
85
* Extract basic info (name, style, etc)

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
}
1717
},
1818
"config": {
19-
"bin-dir": "bin"
19+
"bin-dir": "bin"
2020
},
2121
"require-dev": {
22-
"phpunit/phpunit": "^4.8.35 || ^5 || ^6 || ^7"
22+
"symfony/phpunit-bridge" : "^3 || ^4 || ^5"
2323
}
2424
}

tests/FontLib/FontTest.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@
77

88
class FontTest extends TestCase
99
{
10-
/**
11-
* @expectedException \Fontlib\Exception\FontNotFoundException
12-
*/
1310
public function testLoadFileNotFound()
1411
{
15-
Font::load('non-existing/font.ttf');
12+
// @todo when PHP 5.4 support is dropped, uncomment line below and drop
13+
// the try...catch block.
14+
// $this->expectException('\Fontlib\Exception\FontNotFoundException');
15+
try {
16+
Font::load('non-existing/font.ttf');
17+
$this->fail('Load should have failed.');
18+
}
19+
catch (\Fontlib\Exception\FontNotFoundException $e) {
20+
// Avoid throwing a risky test error.
21+
$this->assertTrue(true);
22+
}
1623
}
1724

1825
public function testLoadTTFFontSuccessfully()

0 commit comments

Comments
 (0)