Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit188403e

Browse files
authored
Merge pull request#73 from hason-contributions/php8
Enable PHP 8.0 and use Github Actions
2 parents6ad9e40 +a403313 commit188403e

16 files changed

+80
-116
lines changed

‎.github/workflows/tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name:Tests
2+
3+
on:
4+
push:~
5+
pull_request:~
6+
7+
jobs:
8+
phpunit:
9+
name:PHPUnit on ${{ matrix.php }} and Twig ${{ matrix.twig }} ${{ matrix.dependencies }}
10+
runs-on:ubuntu-latest
11+
strategy:
12+
matrix:
13+
dependencies:['', 'lowest']
14+
php:[ '7.1', '7.2', '7.3', '7.4', '8.0' ]
15+
twig:[ ^1.0, ^2.0, ^3.0 ]
16+
exclude:
17+
-php:'7.1'
18+
twig:^3.0
19+
steps:
20+
-name:Update code
21+
uses:actions/checkout@v2
22+
23+
-name:Setup PHP
24+
uses:shivammathur/setup-php@v2
25+
with:
26+
php-version:${{ matrix.php }}
27+
extensions:dom
28+
coverage:pcov
29+
tools:composer:v2
30+
31+
-name:Install dependencies
32+
run:composer update --no-progress --with "twig/twig:${{ matrix.twig }}"
33+
34+
-name:Install lowest dependencies
35+
run:composer update --no-progress --prefer-lowest --root-reqs --with "twig/twig:${{ matrix.twig }}"
36+
if:matrix.dependencies
37+
38+
-name:Run tests
39+
run:vendor/bin/phpunit --no-coverage
40+
if:matrix.php != '8.0'
41+
42+
-name:Run tests with code coverage
43+
run:vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
44+
if:matrix.php == '8.0'
45+
46+
-name:Upload code coverage tu Scrutinizer
47+
run:php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
48+
if:matrix.php == '8.0'

‎.travis.yml

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

‎composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
"homepage" :"https://github.com/goetas/twital",
1616
"license" :"MIT",
1717
"require" : {
18-
"php" :"^5.5|^7.0",
18+
"php" :"^7.1|^8.0",
1919
"ext-dom":"*",
2020
"masterminds/html5" :"^2.1.2",
21-
"twig/twig" :"^1.38|^2.4|^3.0",
22-
"symfony/event-dispatcher" :"^3.0|^4.0|^5.0"
21+
"twig/twig" :"^1.43|^2.13|^3.0",
22+
"symfony/event-dispatcher" :"^3.4|^4.4|^5.1"
2323
},
2424
"require-dev" : {
25-
"phpunit/phpunit" :"4.8.34|^5.6.3|^6.0|^7.0",
25+
"phpunit/phpunit" :"^7.5|^8.0|^9.0",
2626
"friendsofphp/php-cs-fixer":"^2.2",
27-
"sebastian/comparator":">=1.2.3",
28-
"symfony/var-dumper":"^3.0|^4.0|^5.0"
27+
"scrutinizer/ocular":"^1.3",
28+
"symfony/var-dumper":"^3.4|^4.4|^5.1"
2929
},
3030
"autoload" : {
3131
"psr-4" : {

‎phpunit.xml.dist

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
<directory>./tests/</directory>
2121
</testsuite>
2222
</testsuites>
23-
<whitelist>
24-
<directory>src</directory>
25-
</whitelist>
23+
<filter>
24+
<whitelist>
25+
<directory>src</directory>
26+
</whitelist>
27+
</filter>
2628
</phpunit>
2729

‎src/SourceAdapter/XMLAdapter.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,15 @@ protected function collectMetadata(\DOMDocument $dom, $source)
6565
protectedfunctioncreateDom($source)
6666
{
6767
$internalErrors =libxml_use_internal_errors(true);
68-
$disableEntities =libxml_disable_entity_loader(true);
6968
libxml_clear_errors();
7069

7170
$dom =new \DOMDocument('1.0','UTF-8');
7271
if ('' !==trim($source) && !$dom->loadXML($source,LIBXML_NONET | (defined('LIBXML_COMPACT') ?LIBXML_COMPACT :0))) {
73-
libxml_disable_entity_loader($disableEntities);
7472

7573
thrownew \InvalidArgumentException(implode("\n",$this->getXmlErrors($internalErrors)));
7674
}
7775

7876
libxml_use_internal_errors($internalErrors);
79-
libxml_disable_entity_loader($disableEntities);
8077

8178
return$dom;
8279
}

‎tests/Tests/ContextAwareEscapingTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
useGoetas\Twital\SourceAdapter\XHTMLAdapter;
66
useGoetas\Twital\SourceAdapter\XMLAdapter;
77
useGoetas\Twital\Twital;
8+
usePHPUnit\Framework\TestCase;
89

910
class ContextAwareEscapingTestextends TestCase
1011
{
@@ -13,7 +14,7 @@ class ContextAwareEscapingTest extends TestCase
1314
/**
1415
* Prepares the environment before running a test.
1516
*/
16-
protectedfunctionsetUp()
17+
protectedfunctionsetUp():void
1718
{
1819
$this->twital =newTwital();
1920
}

‎tests/Tests/CoreAttributeTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33

44
useGoetas\Twital\SourceAdapter\XMLAdapter;
55
useGoetas\Twital\Twital;
6+
usePHPUnit\Framework\TestCase;
67

78
class CoreAttributeTestextends TestCase
89
{
910
/**
1011
* Prepares the environment before running a test.
1112
*/
12-
protectedfunctionsetUp()
13+
protectedfunctionsetUp():void
1314
{
1415
parent::setUp();
1516
$this->twital =newTwital();

‎tests/Tests/CoreNodesTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
namespaceGoetas\Twital\Tests;
33

44
useGoetas\Twital\Twital;
5+
usePHPUnit\Framework\TestCase;
56

67
abstractclass CoreNodesTestextends TestCase
78
{
@@ -10,7 +11,7 @@ abstract class CoreNodesTest extends TestCase
1011
/**
1112
* Prepares the environment before running a test.
1213
*/
13-
protectedfunctionsetUp()
14+
protectedfunctionsetUp():void
1415
{
1516
parent::setUp();
1617
$this->twital =newTwital();

‎tests/Tests/DynamicAttrAttributeTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
useGoetas\Twital\SourceAdapter\XMLAdapter;
55
useGoetas\Twital\TwitalLoader;
6+
usePHPUnit\Framework\TestCase;
67
useTwig\Environment;
78
useTwig\Loader\ArrayLoader;
89

@@ -21,7 +22,7 @@ class DynamicAttrAttributeTest extends TestCase
2122
/**
2223
* Prepares the environment before running a test.
2324
*/
24-
protectedfunctionsetUp()
25+
protectedfunctionsetUp():void
2526
{
2627
parent::setUp();
2728

@@ -120,10 +121,10 @@ public function getInvalidData()
120121

121122
/**
122123
* @dataProvider getInvalidData
123-
* @expectedException \Exception
124124
*/
125125
publicfunctiontestInvalidVisitAttribute($source)
126126
{
127+
$this->expectException(\Exception::class);
127128
$this->loader->setTemplate('template',$source);
128129
$this->twig->render('template');
129130
}

‎tests/Tests/Event/SourceEventTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
namespaceGoetas\Twital\Tests\Event;
33

44
useGoetas\Twital\EventDispatcher\SourceEvent;
5-
useGoetas\Twital\Tests\TestCase;
65
useGoetas\Twital\Twital;
6+
usePHPUnit\Framework\TestCase;
77

88
class SourceEventTestextends TestCase
99
{
@@ -12,7 +12,7 @@ class SourceEventTest extends TestCase
1212
/**
1313
* Prepares the environment before running a test.
1414
*/
15-
protectedfunctionsetUp()
15+
protectedfunctionsetUp():void
1616
{
1717
parent::setUp();
1818
$this->twital =newTwital();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp