Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"php": ">=8.1.0"
},
"require-dev": {
"phpunit/phpunit": ">=5.0.0 <8.5.27"
"phpunit/phpunit": "^10"
},
"suggest": {
"ext-bcmath": "Need to support JSON deserialization"
Expand Down
2 changes: 1 addition & 1 deletion php/composer.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"php": ">=8.1.0"
},
"require-dev": {
"phpunit/phpunit": ">=5.0.0 <8.5.27"
"phpunit/phpunit": "^10"
},
"suggest": {
"ext-bcmath": "Need to support JSON deserialization"
Expand Down
2 changes: 1 addition & 1 deletion php/tests/EncodeDecodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,7 @@ public function testWrapperSetUnwrappedJsonEncode(
$this->assertEquals($defaultValue, $to->getOneofFieldUnwrapped());
}

public function wrappersDataProvider()
public static function wrappersDataProvider()
{
return [
[TestInt32Value::class, 1, "1", 0, "0"],
Expand Down
12 changes: 6 additions & 6 deletions php/tests/GeneratedClassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1964,15 +1964,15 @@ public function testSpecialCharacters()
$this->assertEquals(' */', array_pop($commentLines));
$docComment = implode("\n", $commentLines);
// test special characters
$this->assertContains(";,/?:&=+$-_.!~*'()", $docComment);
$this->assertStringContains(";,/?:&=+$-_.!~*'()", $docComment);
// test open doc comment
$this->assertContains('/*', $docComment);
$this->assertStringContains('/*', $docComment);
// test escaped closed doc comment
$this->assertNotContains('*/', $docComment);
$this->assertContains('{@*}', $docComment);
$this->assertStringNotContainsString('*/', $docComment);
$this->assertStringContains('{@*}', $docComment);
// test escaped at-sign
$this->assertContains('\@foo', $docComment);
$this->assertStringContains('\@foo', $docComment);
// test forwardslash on new line
$this->assertContains("* /\n", $docComment);
$this->assertStringContains("* /\n", $docComment);
}
}
2 changes: 1 addition & 1 deletion php/tests/GeneratedPhpdocTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testPhpDocForIntGetters($methods, $expectedDoc)
}
}

public function providePhpDocForGettersAndSetters()
public static function providePhpDocForGettersAndSetters()
{
return [
[
Expand Down
2 changes: 1 addition & 1 deletion php/tests/PhpImplementationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ public function testArrayConstructorWithNullValuesThrowsException($requestData)
$m = new TestMessage($requestData);
}

public function provideArrayConstructorWithNullValuesThrowsException()
public static function provideArrayConstructorWithNullValuesThrowsException()
{
return [
[['optional_int32' => null]],
Expand Down
4 changes: 3 additions & 1 deletion php/tests/PreviouslyGeneratedClassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class PreviouslyGeneratedClassTest extends TestBase
public function testPrefixForReservedWords()
{
// In newer versions of PHP, we cannot reference the old class name.
if (version_compare(phpversion(), '8.1.0', '>=')) return;
if (version_compare(phpversion(), '8.1.0', '>=')) {
$this->markTestSkipped('Skipping test on PHP 8.1 or newer, since readonly is a reserved word since PHP 8.1.');
}

// For older versions of PHP, verify that we can reference the
// original class name.
Expand Down
4 changes: 2 additions & 2 deletions php/tests/WellKnownTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public function testEnumNameValueConversion($class)
}
}

public function enumNameValueConversionDataProvider()
public static function enumNameValueConversionDataProvider()
{
return [
['\Google\Protobuf\Field\Cardinality'],
Expand All @@ -467,7 +467,7 @@ public function testReflectionProperty($property, $default)
self::assertNull($reflectionProperty->getValue($testMessage));
}

public function optionalFieldsDataProvider()
public static function optionalFieldsDataProvider()
{
return [
['true_optional_int32', 0],
Expand Down
10 changes: 5 additions & 5 deletions php/tests/WrapperTypeSettersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function testGettersAndSetters(
}
}

public function gettersAndSettersDataProvider()
public static function gettersAndSettersDataProvider()
{
return [
[TestWrapperSetters::class, DoubleValue::class, "setDoubleValue", "setDoubleValueUnwrapped", "getDoubleValue", "getDoubleValueUnwrapped", [
Expand Down Expand Up @@ -155,7 +155,7 @@ public function testInvalidSetters($class, $setter, $value)
(new $class())->$setter($value);
}

public function invalidSettersDataProvider()
public static function invalidSettersDataProvider()
{
return [
[TestWrapperSetters::class, "setDoubleValueUnwrapped", "abc"],
Expand Down Expand Up @@ -212,7 +212,7 @@ public function testConstructorWithWrapperType($class, $wrapperClass, $wrapperFi
$this->assertEquals($expectedInstance->$getter()->getValue(), $actualInstance->$getter()->getValue());
}

public function constructorWithWrapperTypeDataProvider()
public static function constructorWithWrapperTypeDataProvider()
{
return [
[TestWrapperSetters::class, DoubleValue::class, 'double_value', 'getDoubleValue', 1.1],
Expand Down Expand Up @@ -247,7 +247,7 @@ public function testConstructorWithRepeatedWrapperType($wrapperField, $getter, $
$this->assertTrue(true);
}

public function constructorWithRepeatedWrapperTypeDataProvider()
public static function constructorWithRepeatedWrapperTypeDataProvider()
{
$sv7 = new StringValue(['value' => 'seven']);
$sv8 = new StringValue(['value' => 'eight']);
Expand Down Expand Up @@ -292,7 +292,7 @@ public function testConstructorWithMapWrapperType($wrapperField, $getter, $value
$this->assertTrue(true);
}

public function constructorWithMapWrapperTypeDataProvider()
public static function constructorWithMapWrapperTypeDataProvider()
{
$sv7 = new StringValue(['value' => 'seven']);
$sv8 = new StringValue(['value' => 'eight']);
Expand Down
Loading