Skip to content

Commit ed966a9

Browse files
committed
CI: add something to run php tests
1 parent 0f41c2e commit ed966a9

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

.github/workflows/php-ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: PHP CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'php/**'
9+
- '.github/workflows/php-ci.yml'
10+
pull_request:
11+
paths:
12+
- 'php/**'
13+
- '.github/workflows/php-ci.yml'
14+
jobs:
15+
build-test:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: PHPUnit Tests
21+
uses: php-actions/phpunit@v3
22+
with:
23+
version: latest
24+
configuration: "php/phpunit.xml"
25+
test_suffix: "Test.php"

php/init.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
require __DIR__ . '/src/Webhook.php';
44
require __DIR__ . '/src/Exception/WebhookVerificationException.php';
5+
require __DIR__ . '/src/Exception/WebhookSigningException.php';

php/phpunit.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<phpunit bootstrap="tests/bootstrap.php">
2+
<testsuites>
3+
<testsuite name="unit">
4+
<directory>tests/</directory>
5+
</testsuite>
6+
</testsuites>
7+
</phpunit>

php/tests/bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<?php
22

33
require_once __DIR__ . '/../init.php';
4+
require_once __DIR__ . '/TestPayload.php';

0 commit comments

Comments
 (0)