Skip to content

Commit 7c0d2a2

Browse files
protobuf-github-botJasonLunn
authored andcommitted
Bump version dependencies on phpunit/phpunit to ">=10.5.62 <11.0.0"
PiperOrigin-RevId: 861973659
1 parent c4eda3e commit 7c0d2a2

9 files changed

Lines changed: 27 additions & 21 deletions

php/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"php": ">=8.1.0"
1010
},
1111
"require-dev": {
12-
"phpunit/phpunit": ">=5.0.0 <8.5.27"
12+
"phpunit/phpunit": ">=10.5.62 <11.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.1.0"
1010
},
1111
"require-dev": {
12-
"phpunit/phpunit": ">=5.0.0 <8.5.27"
12+
"phpunit/phpunit": ">=10.5.62 <11.0.0"
1313
},
1414
"suggest": {
1515
"ext-bcmath": "Need to support JSON deserialization"

php/tests/EncodeDecodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1596,7 +1596,7 @@ public function testWrapperSetUnwrappedJsonEncode(
15961596
$this->assertEquals($defaultValue, $to->getOneofFieldUnwrapped());
15971597
}
15981598

1599-
public function wrappersDataProvider()
1599+
public static function wrappersDataProvider()
16001600
{
16011601
return [
16021602
[TestInt32Value::class, 1, "1", 0, "0"],

php/tests/GeneratedClassTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,15 +1964,15 @@ public function testSpecialCharacters()
19641964
$this->assertEquals(' */', array_pop($commentLines));
19651965
$docComment = implode("\n", $commentLines);
19661966
// test special characters
1967-
$this->assertContains(";,/?:&=+$-_.!~*'()", $docComment);
1967+
$this->assertStringContainsString(";,/?:&=+$-_.!~*'()", $docComment);
19681968
// test open doc comment
1969-
$this->assertContains('/*', $docComment);
1969+
$this->assertStringContainsString('/*', $docComment);
19701970
// test escaped closed doc comment
1971-
$this->assertNotContains('*/', $docComment);
1972-
$this->assertContains('{@*}', $docComment);
1971+
$this->assertStringNotContainsString('*/', $docComment);
1972+
$this->assertStringContainsString('{@*}', $docComment);
19731973
// test escaped at-sign
1974-
$this->assertContains('\@foo', $docComment);
1974+
$this->assertStringContainsString('\@foo', $docComment);
19751975
// test forwardslash on new line
1976-
$this->assertContains("* /\n", $docComment);
1976+
$this->assertStringContainsString("* /\n", $docComment);
19771977
}
19781978
}

php/tests/GeneratedPhpdocTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public function testPhpDocForConstructor()
1818
{
1919
$class = new ReflectionClass('Foo\TestMessage');
2020
$doc = $class->getMethod('__construct')->getDocComment();
21-
$this->assertStringContains('@param array $data', $doc);
22-
$this->assertStringContains('@type int $optional_int32', $doc);
21+
$this->assertStringContainsString('@param array $data', $doc);
22+
$this->assertStringContainsString('@type int $optional_int32', $doc);
2323
}
2424

2525
/**
@@ -34,7 +34,7 @@ public function testPhpDocForIntGetters($methods, $expectedDoc)
3434
}
3535
}
3636

37-
public function providePhpDocForGettersAndSetters()
37+
public static function providePhpDocForGettersAndSetters()
3838
{
3939
return [
4040
[

php/tests/PhpImplementationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ public function testArrayConstructorWithNullValuesThrowsException($requestData)
582582
$m = new TestMessage($requestData);
583583
}
584584

585-
public function provideArrayConstructorWithNullValuesThrowsException()
585+
public static function provideArrayConstructorWithNullValuesThrowsException()
586586
{
587587
return [
588588
[['optional_int32' => null]],

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.1.0', '>=')) return;
15+
if (version_compare(phpversion(), '8.1.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", [
@@ -155,7 +155,7 @@ public function testInvalidSetters($class, $setter, $value)
155155
(new $class())->$setter($value);
156156
}
157157

158-
public function invalidSettersDataProvider()
158+
public static function invalidSettersDataProvider()
159159
{
160160
return [
161161
[TestWrapperSetters::class, "setDoubleValueUnwrapped", "abc"],
@@ -212,7 +212,7 @@ public function testConstructorWithWrapperType($class, $wrapperClass, $wrapperFi
212212
$this->assertEquals($expectedInstance->$getter()->getValue(), $actualInstance->$getter()->getValue());
213213
}
214214

215-
public function constructorWithWrapperTypeDataProvider()
215+
public static function constructorWithWrapperTypeDataProvider()
216216
{
217217
return [
218218
[TestWrapperSetters::class, DoubleValue::class, 'double_value', 'getDoubleValue', 1.1],
@@ -247,7 +247,7 @@ public function testConstructorWithRepeatedWrapperType($wrapperField, $getter, $
247247
$this->assertTrue(true);
248248
}
249249

250-
public function constructorWithRepeatedWrapperTypeDataProvider()
250+
public static function constructorWithRepeatedWrapperTypeDataProvider()
251251
{
252252
$sv7 = new StringValue(['value' => 'seven']);
253253
$sv8 = new StringValue(['value' => 'eight']);
@@ -292,7 +292,7 @@ public function testConstructorWithMapWrapperType($wrapperField, $getter, $value
292292
$this->assertTrue(true);
293293
}
294294

295-
public function constructorWithMapWrapperTypeDataProvider()
295+
public static function constructorWithMapWrapperTypeDataProvider()
296296
{
297297
$sv7 = new StringValue(['value' => 'seven']);
298298
$sv8 = new StringValue(['value' => 'eight']);

0 commit comments

Comments
 (0)