Skip to content

Commit 90a5696

Browse files
committed
Added GHA workflow for tests.
Removed Travis configuration. Fixed deprecation test for PHP 8.1. Fixed warning test.
1 parent 07ddeba commit 90a5696

File tree

4 files changed

+58
-38
lines changed

4 files changed

+58
-38
lines changed

.github/workflows/Test.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: 0 6 * * *
9+
10+
jobs:
11+
Test:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php:
18+
- 8.1
19+
- 8.2
20+
- 8.3
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Setup PHP ${{ matrix.php }}
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php }}
29+
coverage: pcov
30+
31+
- name: Validate composer.json
32+
run: composer validate
33+
34+
- name: Cache dependencies
35+
id: composer-cache
36+
uses: actions/cache@v4
37+
with:
38+
path: vendor
39+
key: php-${{ matrix.php }}
40+
41+
- name: Install dependencies
42+
run: composer update --no-interaction --no-progress
43+
44+
- name: Run test suite with coverage
45+
run: composer test -- --coverage-clover=build/logs/clover.xml
46+
47+
- name: Upload test coverage
48+
uses: codecov/codecov-action@v4
49+
env:
50+
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/.*/
2+
!/.github/
23
/vendor/
34
/composer.lock

.travis.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

test/CapabilitiesTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,19 @@ public function testNotice(): void
5757

5858
public function testWarning(): void
5959
{
60-
// zend.assertions may be completely enabled or disabled only in php.ini.
61-
ini_set('zend.assertions', -1);
60+
// foreach() argument must be of type array|object.
61+
foreach (1 as $n) {}
6262

6363
self::assertTrue(true);
6464
}
6565

6666
public function testDeprecation(): void
6767
{
68-
// Creation of dynamic property is deprecated.
69-
$this->foo = 'foo';
68+
// Serializable interface is deprecated.
69+
new class implements \Serializable {
70+
function serialize() {}
71+
function unserialize(string $data) {}
72+
};
7073

7174
self::assertTrue(true);
7275
}

0 commit comments

Comments
 (0)