Skip to content

Commit 2a46ed2

Browse files
committed
Fix tests relating to dynamic properties
1 parent e9e6989 commit 2a46ed2

File tree

9 files changed

+30
-4
lines changed

9 files changed

+30
-4
lines changed

tests/apm/commandFailedEvent-002.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ $m = create_test_manager();
1212

1313
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1414
{
15+
private $startRequestId;
16+
private $startOperationId;
17+
1518
public function commandStarted( \MongoDB\Driver\Monitoring\CommandStartedEvent $event ): void
1619
{
1720
echo "started: ", $event->getCommandName(), "\n";

tests/apm/commandSucceededEvent-002.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ $m = create_test_manager();
1212

1313
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1414
{
15+
private $startRequestId;
16+
private $startOperationId;
17+
1518
public function commandStarted( \MongoDB\Driver\Monitoring\CommandStartedEvent $event ): void
1619
{
1720
echo "started: ", $event->getCommandName(), "\n";

tests/bson/bson-encode-003.phpt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ BSON encoding: Encoding objects into BSON representation
66
require_once __DIR__ . '/../utils/basic.inc';
77

88
class MyClass implements MongoDB\BSON\Persistable {
9+
private $props;
10+
911
#[\ReturnTypeWillChange]
1012
public function bsonSerialize() {
1113
return array(
@@ -18,6 +20,8 @@ class MyClass implements MongoDB\BSON\Persistable {
1820
}
1921
}
2022
class MyClass2 implements MongoDB\BSON\Persistable {
23+
private $props;
24+
2125
#[\ReturnTypeWillChange]
2226
public function bsonSerialize() {
2327
return array(
@@ -55,7 +59,7 @@ Test#0 { "stuff" : { "__pclass" : { "$binary" : "TXlDbGFzcw==", "$type" : "80" }
5559
object(stdClass)#%d (1) {
5660
["stuff"]=>
5761
object(MyClass)#%d (1) {
58-
["props"]=>
62+
["props":"MyClass":private]=>
5963
array(3) {
6064
["__pclass"]=>
6165
object(MongoDB\BSON\Binary)#%d (2) {
@@ -79,7 +83,7 @@ Test#1 { "stuff" : { "__pclass" : { "$binary" : "TXlDbGFzczI=", "$type" : "80" }
7983
object(stdClass)#%d (1) {
8084
["stuff"]=>
8185
object(MyClass2)#%d (1) {
82-
["props"]=>
86+
["props":"MyClass2":private]=>
8387
array(4) {
8488
["__pclass"]=>
8589
object(MongoDB\BSON\Binary)#%d (2) {
@@ -112,7 +116,7 @@ object(stdClass)#%d (1) {
112116
array(2) {
113117
[0]=>
114118
object(MyClass)#%d (1) {
115-
["props"]=>
119+
["props":"MyClass":private]=>
116120
array(3) {
117121
["__pclass"]=>
118122
object(MongoDB\BSON\Binary)#%d (2) {
@@ -129,7 +133,7 @@ object(stdClass)#%d (1) {
129133
}
130134
[1]=>
131135
object(MyClass2)#%d (1) {
132-
["props"]=>
136+
["props":"MyClass2":private]=>
133137
array(4) {
134138
["__pclass"]=>
135139
object(MongoDB\BSON\Binary)#%d (2) {

tests/bson/bson-toPHP-003.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class MyClass
99
{
1010
}
1111

12+
#[\AllowDynamicProperties]
1213
class YourClass implements MongoDB\BSON\Unserializable
1314
{
1415
public function bsonUnserialize(array $data): void
@@ -20,6 +21,7 @@ class YourClass implements MongoDB\BSON\Unserializable
2021
}
2122
}
2223

24+
#[\AllowDynamicProperties]
2325
class OurClass implements MongoDB\BSON\Persistable
2426
{
2527
#[\ReturnTypeWillChange]

tests/bson/bug1598-002.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
--TEST--
22
PHPC-1598: BSON type get_gc should delegate to zend_std_get_properties
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_php_version('>=', '8.1.99'); ?>
36
--FILE--
47
<?php
58

tests/readConcern/bug1598-002.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
--TEST--
22
PHPC-1598: ReadConcern get_gc should delegate to zend_std_get_properties
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_php_version('>=', '8.1.99'); ?>
36
--FILE--
47
<?php
58

tests/readPreference/bug1598-002.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
--TEST--
22
PHPC-1598: ReadPreference get_gc should delegate to zend_std_get_properties
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_php_version('>=', '8.1.99'); ?>
36
--FILE--
47
<?php
58

tests/standalone/bug0545.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ PHPC-545: Update does not serialize embedded Persistable's __pclass field
88
<?php
99
require_once __DIR__ . "/../utils/basic.inc";
1010

11+
#[\AllowDynamicProperties]
1112
class Book implements MongoDB\BSON\Persistable
1213
{
1314
#[\ReturnTypeWillChange]
@@ -25,6 +26,7 @@ class Book implements MongoDB\BSON\Persistable
2526
}
2627
}
2728

29+
#[\AllowDynamicProperties]
2830
class Page implements MongoDB\BSON\Persistable
2931
{
3032
#[\ReturnTypeWillChange]

tests/writeConcern/bug1598-002.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
--TEST--
22
PHPC-1598: WriteConcern get_gc should delegate to zend_std_get_properties
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_php_version('>=', '8.1.99'); ?>
36
--FILE--
47
<?php
58

0 commit comments

Comments
 (0)