Skip to content

Commit

Permalink
Merge pull request #881 from xPaw/merge-1.8.x
Browse files Browse the repository at this point in the history
Merge `1.8.x-beta` into `master`
  • Loading branch information
erusev authored Oct 12, 2024
2 parents e76c4e4 + cfb313f commit 582f9f9
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 36 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
- push
- pull_request

jobs:
phpunit:
runs-on: ubuntu-latest

strategy:
matrix:
php:
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
- '8.4'

steps:
- name: Checkout the source code
uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php }}'

- name: Install dependencies
run: composer install

- name: Run tests
run: |
vendor/bin/phpunit
vendor/bin/phpunit test/CommonMarkTestWeak.php || true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
composer.lock
vendor/
.phpunit.result.cache
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
}
],
"require": {
"php": ">=5.3.0",
"php": ">=7.1",
"ext-mbstring": "*"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35"
"phpunit/phpunit": "^7.5|^8.5|^9.6"
},
"autoload": {
"psr-0": {"Parsedown": ""}
Expand Down
6 changes: 4 additions & 2 deletions test/CommonMarkTestStrict.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<?php

use PHPUnit\Framework\TestCase;

/**
* Test Parsedown against the CommonMark spec
*
* @link http://commonmark.org/ CommonMark
*/
class CommonMarkTestStrict extends PHPUnit_Framework_TestCase
class CommonMarkTestStrict extends TestCase
{
const SPEC_URL = 'https://raw.githubusercontent.com/jgm/CommonMark/master/spec.txt';

protected $parsedown;

protected function setUp()
protected function setUp() : void
{
$this->parsedown = new TestParsedown();
$this->parsedown->setUrlsLinked(false);
Expand Down
2 changes: 1 addition & 1 deletion test/CommonMarkTestWeak.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CommonMarkTestWeak extends CommonMarkTestStrict
{
protected $textLevelElementRegex;

protected function setUp()
protected function setUp() : void
{
parent::setUp();

Expand Down
4 changes: 3 additions & 1 deletion test/data/fenced_code_block.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
<pre><code>foo


bar</code></pre>
bar</code></pre>
<pre><code class="language-php">&lt;?php
echo "Hello World";</code></pre>
5 changes: 5 additions & 0 deletions test/data/fenced_code_block.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@ foo
bar
```

```php some-class
<?php
echo "Hello World";
```

0 comments on commit 582f9f9

Please sign in to comment.