Skip to content

Commit c40a6f9

Browse files
committed
fix debuginfo tests
1 parent 916eeb0 commit c40a6f9

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

php/tests/DebugInfoTest.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,25 @@
3434

3535
class DebugInfoTest extends TestBase
3636
{
37+
public function setUp(): void
38+
{
39+
if (extension_loaded('protobuf')) {
40+
$this->markTestSkipped('__debugInfo is not supported for the protobuf extension');
41+
}
42+
}
43+
3744
public function testVarDumpOutput()
3845
{
3946
$m = new DoubleValue();
4047
$m->setValue(1.5);
4148
var_dump($m);
42-
$this->expectOutputString(<<<EOL
43-
object(Google\Protobuf\DoubleValue)#12 (1) {
49+
$regex = <<<EOL
50+
object(Google\Protobuf\DoubleValue)#%s (1) {
4451
["value"]=>
4552
float(1.5)
4653
}
47-
48-
EOL);
54+
EOL;
55+
$this->expectOutputRegex('/' . sprintf(preg_quote($regex), '\d+') . '/');
4956
}
5057

5158
public function testTopLevelDoubleValue()

0 commit comments

Comments
 (0)