Skip to content

Commit 495b3c5

Browse files
authored
Merge pull request #30 from nutama/phpunit9
update to phpunit 9
2 parents 245c3d4 + 01bfbc9 commit 495b3c5

File tree

5 files changed

+24
-31
lines changed

5 files changed

+24
-31
lines changed

.github/workflows/main.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
php-versions: ['7.3', '7.4']
11+
php-versions: ['7.3', '7.4', '8.0']
1212
name: PHP ${{ matrix.php-versions }}
1313
steps:
1414
- uses: actions/checkout@v2

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"require-dev": {
1818
"hostnet/phpcs-tool": "^8.3",
19-
"phpunit/phpunit": "^7.0",
19+
"phpunit/phpunit": "^9.5.6",
2020
"symfony/finder": "^5.0"
2121
},
2222
"autoload": {

phpunit.xml.dist

+15-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation = "http://schema.phpunit.de/5.1/phpunit.xsd"
5-
colors = "true"
6-
bootstrap = "vendor/autoload.php"
7-
>
8-
<php>
9-
<server name="KERNEL_CLASS" value="TestKernel"/>
10-
<server name="KERNEL_DIR" value="test/Functional/Fixtures"/>
11-
</php>
12-
<testsuites>
13-
<testsuite name="unit-test">
14-
<directory>./test</directory>
15-
</testsuite>
16-
</testsuites>
17-
<filter>
18-
<whitelist>
19-
<directory>src</directory>
20-
</whitelist>
21-
</filter>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" colors="true" bootstrap="vendor/autoload.php">
3+
<coverage>
4+
<include>
5+
<directory>src</directory>
6+
</include>
7+
</coverage>
8+
<php>
9+
<server name="KERNEL_CLASS" value="TestKernel"/>
10+
<server name="KERNEL_DIR" value="test/Functional/Fixtures"/>
11+
</php>
12+
<testsuites>
13+
<testsuite name="unit-test">
14+
<directory>./test</directory>
15+
</testsuite>
16+
</testsuites>
2217
</phpunit>

test/DependencyInjection/EnumTranslationCompilerPassTest.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ public function testProcess()
6363
$this->assertEquals(['addResource', ['enum', $resources, 'en', MockEnum::class]], $calls[0]);
6464
}
6565

66-
/**
67-
* @expectedException \RuntimeException
68-
*/
6966
public function testProcessNotYml()
7067
{
7168
$resources = realpath(__DIR__ . '/../MockXml/Resources/translations/enum.en.xml');
@@ -78,6 +75,8 @@ public function testProcessNotYml()
7875
$container->setDefinition('translator.default', $translator);
7976

8077
$pass = new EnumTranslationCompilerPass();
78+
79+
$this->expectException(\RuntimeException::class);
8180
$pass->process($container);
8281
}
8382

@@ -99,9 +98,6 @@ public function testProcessNoTrans()
9998
$this->assertEquals(0, count($calls));
10099
}
101100

102-
/**
103-
* @expectedException \RuntimeException
104-
*/
105101
public function testProcessNoArray()
106102
{
107103
$resources = realpath(__DIR__ . '/../MockNoArray/Resources/translations/enum.en.yml');
@@ -114,6 +110,8 @@ public function testProcessNoArray()
114110
$container->setDefinition('translator.default', $translator);
115111

116112
$pass = new EnumTranslationCompilerPass();
113+
114+
$this->expectException(\RuntimeException::class);
117115
$pass->process($container);
118116
}
119117
}

test/Loader/EnumLoaderTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ public function testTranslationArray(): void
7373
);
7474
}
7575

76-
/**
77-
* @expectedException \RuntimeException
78-
*/
7976
public function testNonEnumLoad(): void
8077
{
8178
$yml_loader = new YamlFileLoader();
@@ -89,6 +86,9 @@ public function testNonEnumLoad(): void
8986
'en',
9087
'phpunit'
9188
);
89+
90+
$this->expectException(\RuntimeException::class);
91+
9292
$translator->trans((string) 0, [], 'phpunit');
9393
}
9494
}

0 commit comments

Comments
 (0)