Skip to content

Commit 4e82ce4

Browse files
protobuf-github-botJasonLunn
authored andcommitted
Bump version dependencies on phpunit/phpunit to ">=11.5.0 <12.0.0"
PiperOrigin-RevId: 861973659 (cherry picked from commit b9ab581)
1 parent 04cd392 commit 4e82ce4

File tree

8 files changed

+24
-14
lines changed

8 files changed

+24
-14
lines changed

php/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"php": ">=8.2.0"
1010
},
1111
"require-dev": {
12-
"phpunit/phpunit": ">=5.0.0 <8.5.27"
12+
"phpunit/phpunit": ">=11.5.0 <12.0.0"
1313
},
1414
"suggest": {
1515
"ext-bcmath": "Need to support JSON deserialization"

php/composer.json.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"php": ">=8.2.0"
1010
},
1111
"require-dev": {
12-
"phpunit/phpunit": ">=5.0.0 <8.5.27"
12+
"phpunit/phpunit": ">=11.5.0 <12.0.0"
1313
},
1414
"suggest": {
1515
"ext-bcmath": "Need to support JSON deserialization"

php/tests/EncodeDecodeTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,10 @@ public function testRecursiveMessage() {
629629

630630
$m = new TestMessage();
631631
$m->mergeFromString($payload);
632+
633+
// If execution reaches this line, it means no exception was thrown.
634+
// This assertion prevents PHPUnit from marking the test as risky.
635+
$this->assertTrue(true);
632636
}
633637

634638
public function testOverlyRecursiveMessage() {
@@ -1636,7 +1640,7 @@ public function testWrapperSetUnwrappedJsonEncode(
16361640
$this->assertEquals($defaultValue, $to->getOneofFieldUnwrapped());
16371641
}
16381642

1639-
public function wrappersDataProvider()
1643+
public static function wrappersDataProvider()
16401644
{
16411645
return [
16421646
[TestInt32Value::class, 1, "1", 0, "0"],

php/tests/GeneratedPhpdocTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testPhpDocForEnum($method, $enumClass)
3535
);
3636
}
3737

38-
public function providePhpDocForEnum()
38+
public static function providePhpDocForEnum()
3939
{
4040
return [
4141
['getOptionalEnum', '\Foo\TestEnum'],
@@ -69,7 +69,7 @@ public function testPhpDocForIntGetters($methods, $expectedDoc)
6969
}
7070
}
7171

72-
public function providePhpDocForGettersAndSetters()
72+
public static function providePhpDocForGettersAndSetters()
7373
{
7474
return [
7575
[

php/tests/PhpImplementationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ public function testArrayConstructorWithNullValuesThrowsException($fieldName)
576576
$m = new TestMessage([$fieldName => null]);
577577
}
578578

579-
public function provideArrayConstructorWithNullValuesThrowsException()
579+
public static function provideArrayConstructorWithNullValuesThrowsException()
580580
{
581581
return [
582582
['optional_bool'],

php/tests/PreviouslyGeneratedClassTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@ class PreviouslyGeneratedClassTest extends TestBase
1212
public function testPrefixForReservedWords()
1313
{
1414
// In newer versions of PHP, we cannot reference the old class name.
15-
if (version_compare(phpversion(), '8.2.0', '>=')) return;
15+
if (version_compare(phpversion(), '8.2.0', '>=')) {
16+
$this->markTestSkipped('readonly is reserved in PHP >= 8.2');
17+
}
1618

1719
// For older versions of PHP, verify that we can reference the
1820
// original class name.
1921
eval('
2022
$m = new \Previous\readonly();
2123
$this->assertTrue(true);
2224
');
25+
26+
// If execution reaches this line, it means no exception was thrown.
27+
// This assertion prevents PHPUnit from marking the test as risky.
28+
$this->assertTrue(true);
2329
}
2430
}

php/tests/WellKnownTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ public function testEnumNameValueConversion($class)
441441
}
442442
}
443443

444-
public function enumNameValueConversionDataProvider()
444+
public static function enumNameValueConversionDataProvider()
445445
{
446446
return [
447447
['\Google\Protobuf\Field\Cardinality'],
@@ -467,7 +467,7 @@ public function testReflectionProperty($property, $default)
467467
self::assertNull($reflectionProperty->getValue($testMessage));
468468
}
469469

470-
public function optionalFieldsDataProvider()
470+
public static function optionalFieldsDataProvider()
471471
{
472472
return [
473473
['true_optional_int32', 0],

php/tests/WrapperTypeSettersTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testGettersAndSetters(
5757
}
5858
}
5959

60-
public function gettersAndSettersDataProvider()
60+
public static function gettersAndSettersDataProvider()
6161
{
6262
return [
6363
[TestWrapperSetters::class, DoubleValue::class, "setDoubleValue", "setDoubleValueUnwrapped", "getDoubleValue", "getDoubleValueUnwrapped", [
@@ -172,7 +172,7 @@ public function testInvalidSetters($setter, $value)
172172
(new TestWrapperSetters())->$setter($value);
173173
}
174174

175-
public function invalidSettersDataProvider()
175+
public static function invalidSettersDataProvider()
176176
{
177177
return [
178178
["setDoubleValueUnwrapped", "abc"],
@@ -224,7 +224,7 @@ public function testConstructorWithWrapperType($class, $wrapperClass, $wrapperFi
224224
$this->assertEquals($expectedInstance->$getter()->getValue(), $actualInstance->$getter()->getValue());
225225
}
226226

227-
public function constructorWithWrapperTypeDataProvider()
227+
public static function constructorWithWrapperTypeDataProvider()
228228
{
229229
return [
230230
[TestWrapperSetters::class, DoubleValue::class, 'double_value', 'getDoubleValue', 1.1],
@@ -259,7 +259,7 @@ public function testConstructorWithRepeatedWrapperType($wrapperField, $getter, $
259259
$this->assertTrue(true);
260260
}
261261

262-
public function constructorWithRepeatedWrapperTypeDataProvider()
262+
public static function constructorWithRepeatedWrapperTypeDataProvider()
263263
{
264264
$sv7 = new StringValue(['value' => 'seven']);
265265
$sv8 = new StringValue(['value' => 'eight']);
@@ -304,7 +304,7 @@ public function testConstructorWithMapWrapperType($wrapperField, $getter, $value
304304
$this->assertTrue(true);
305305
}
306306

307-
public function constructorWithMapWrapperTypeDataProvider()
307+
public static function constructorWithMapWrapperTypeDataProvider()
308308
{
309309
$sv7 = new StringValue(['value' => 'seven']);
310310
$sv8 = new StringValue(['value' => 'eight']);

0 commit comments

Comments
 (0)