Skip to content

Commit 61a6072

Browse files
committed
run tests using GitHub actions
1 parent f7285e7 commit 61a6072

File tree

4 files changed

+48
-4
lines changed

4 files changed

+48
-4
lines changed

.github/workflows/unit-tests.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
on:
2+
- push
3+
- pull_request
4+
5+
jobs:
6+
phpunit:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
php:
12+
- '5.3'
13+
- '5.4'
14+
- '5.5'
15+
- '5.6'
16+
- '7.0'
17+
- '7.1'
18+
- '7.2'
19+
- '7.3'
20+
- '7.4'
21+
- '8.0'
22+
- '8.1'
23+
- '8.2'
24+
- '8.3'
25+
- '8.4'
26+
27+
steps:
28+
- name: Checkout the source code
29+
uses: actions/checkout@v4
30+
31+
- name: Set up PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: '${{ matrix.php }}'
35+
36+
- name: Install dependencies
37+
run: composer install
38+
39+
- name: Run tests
40+
run: |
41+
vendor/bin/phpunit
42+
vendor/bin/phpunit test/CommonMarkTestWeak.php || true

Parsedown.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ protected function blockRule($Line)
712712
#
713713
# Setext
714714

715-
protected function blockSetextHeader($Line, ?array $Block = null)
715+
protected function blockSetextHeader($Line, array $Block = null)
716716
{
717717
if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
718718
{
@@ -850,7 +850,7 @@ protected function blockReference($Line)
850850
#
851851
# Table
852852

853-
protected function blockTable($Line, ?array $Block = null)
853+
protected function blockTable($Line, array $Block = null)
854854
{
855855
if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
856856
{

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"ext-mbstring": "*"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^4.8.35"
20+
"phpunit/phpunit": "^4.8|^5.7|^6.5|^7.5|^8.5|^9.6"
2121
},
2222
"autoload": {
2323
"psr-0": {"Parsedown": ""}

test/CommonMarkTestStrict.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22

3+
use PHPUnit\Framework\TestCase;
4+
35
/**
46
* Test Parsedown against the CommonMark spec
57
*
68
* @link http://commonmark.org/ CommonMark
79
*/
8-
class CommonMarkTestStrict extends PHPUnit_Framework_TestCase
10+
class CommonMarkTestStrict extends TestCase
911
{
1012
const SPEC_URL = 'https://raw.githubusercontent.com/jgm/CommonMark/master/spec.txt';
1113

0 commit comments

Comments
 (0)