Skip to content

Commit 290e1fa

Browse files
committed
build: Update phpunit/phpunit to 10.5.58
- Update PHPUnit config for version 10 with `--migrate-configuration` - Enabled options to display all notices, deprecations, etc. - Make dataprovider static (T332865) Change-Id: I4f4827fe41004d4fda628ea2964d272dcba47634
1 parent 60854d6 commit 290e1fa

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"ockcyp/covers-validator": "1.7.0",
2929
"php-parallel-lint/php-console-highlighter": "1.0.0",
3030
"php-parallel-lint/php-parallel-lint": "1.4.0",
31-
"phpunit/phpunit": "9.6.21"
31+
"phpunit/phpunit": "10.5.58"
3232
},
3333
"scripts": {
3434
"test": [

phpunit.xml.dist

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
<?xml version="1.0"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutOutputDuringTests="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage includeUncoveredFiles="true">
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
colors="true"
5+
displayDetailsOnTestsThatTriggerDeprecations="true"
6+
displayDetailsOnTestsThatTriggerErrors="true"
7+
displayDetailsOnTestsThatTriggerNotices="true"
8+
displayDetailsOnTestsThatTriggerWarnings="true"
9+
displayDetailsOnPhpunitDeprecations="true"
10+
requireCoverageMetadata="true"
11+
beStrictAboutTestsThatDoNotTestAnything="true"
12+
beStrictAboutOutputDuringTests="true"
13+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd">
14+
<source>
415
<include>
516
<directory suffix=".php">./src</directory>
617
</include>
7-
</coverage>
18+
</source>
819
<testsuites>
920
<testsuite name="textcat Tests">
1021
<directory>./tests</directory>

tests/TextCatTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testCreateLMLimit() {
6868
$this->assertEquals( $result, $lm );
6969
}
7070

71-
public function getTexts() {
71+
public static function getTexts() {
7272
$indir = __DIR__ . "/data/ShortTexts";
7373
$outdir = __DIR__ . "/data/Models";
7474
$data = [];
@@ -110,7 +110,7 @@ public function testFileLines( $textFile ) {
110110
$this->assertEquals( basename( $textFile, ".txt" ), key( $detect ) );
111111
}
112112

113-
public function multiCatData() {
113+
public static function multiCatData() {
114114
return [
115115
[ 'this is english text français bisschen',
116116
[ 'sco', 'en', 'fr', 'de' ],
@@ -143,7 +143,7 @@ public function testMultiCat( $testLine, $res1, $res2 ) {
143143
array_values( $res2 ) );
144144
}
145145

146-
public function minInputLengthData() {
146+
public static function minInputLengthData() {
147147
return [
148148
[ 'eso es español',
149149
[ 'spanish', 'catalan', 'portuguese' ], null, ],
@@ -191,7 +191,7 @@ public function testMinInputLength( $testLine, $lang, $res ) {
191191
$this->testcat->setResultsRatio( 1.05 );
192192
}
193193

194-
public function ambiguityData() {
194+
public static function ambiguityData() {
195195
return [
196196
// check effects of results ratio and max returned langs
197197
[ 'espanol português', 1.05, 10, 3000, 1.00, [ 'pt' ], '' ],
@@ -264,7 +264,7 @@ public function testAmbiguity( $testLine, $resRatio, $maxRetLang, $modelSize, $m
264264
$this->assertEquals( $this->ambiguouscat->getResultStatus(), $errMsg );
265265
}
266266

267-
public function boostedLangData() {
267+
public static function boostedLangData() {
268268
return [
269269
[ 'this is english text français bisschen',
270270
[ 'sco', 'en', 'fr', 'de' ],
@@ -335,7 +335,7 @@ public function testWordSep() {
335335
$this->assertEquals( $this->testcat->classify( "espanol português" ), $weirdResults );
336336
}
337337

338-
public function wrongData() {
338+
public static function wrongData() {
339339
return [
340340
// test wrong-keyboard input
341341
[ 'пукьфт сгшышту', [ 'en_cyr' ], '' ],

0 commit comments

Comments
 (0)