diff --git a/tests/Collection/CollectionFunctionalTest.php b/tests/Collection/CollectionFunctionalTest.php index e4f6c649a..62d17d8cb 100644 --- a/tests/Collection/CollectionFunctionalTest.php +++ b/tests/Collection/CollectionFunctionalTest.php @@ -157,13 +157,13 @@ function (): void { }, function (array $event): void { $command = $event['started']->getCommand(); - $this->assertObjectHasAttribute('comment', $command); - $this->assertObjectHasAttribute('commitQuorum', $command); - $this->assertObjectHasAttribute('lsid', $command); - $this->assertObjectHasAttribute('maxTimeMS', $command); - $this->assertObjectHasAttribute('writeConcern', $command); - $this->assertObjectHasAttribute('sparse', $command->indexes[0]); - $this->assertObjectHasAttribute('unique', $command->indexes[0]); + $this->assertObjectHasProperty('comment', $command); + $this->assertObjectHasProperty('commitQuorum', $command); + $this->assertObjectHasProperty('lsid', $command); + $this->assertObjectHasProperty('maxTimeMS', $command); + $this->assertObjectHasProperty('writeConcern', $command); + $this->assertObjectHasProperty('sparse', $command->indexes[0]); + $this->assertObjectHasProperty('unique', $command->indexes[0]); }, ); } @@ -752,8 +752,8 @@ function () use ($method, $collection, $session): void { call_user_func($method, $collection, $session); }, function (array $event): void { - $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand()); - $this->assertObjectNotHasAttribute('readConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('writeConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('readConcern', $event['started']->getCommand()); }, ); } diff --git a/tests/Database/DatabaseFunctionalTest.php b/tests/Database/DatabaseFunctionalTest.php index c5f337bfc..cb536a50f 100644 --- a/tests/Database/DatabaseFunctionalTest.php +++ b/tests/Database/DatabaseFunctionalTest.php @@ -83,7 +83,7 @@ public function testCommand(): void $commandResult = current($cursor->toArray()); $this->assertCommandSucceeded($commandResult); - $this->assertObjectHasAttribute('ok', $commandResult); + $this->assertObjectHasProperty('ok', $commandResult); $this->assertSame(1, (int) $commandResult->ok); } diff --git a/tests/DocumentationExamplesTest.php b/tests/DocumentationExamplesTest.php index e325b4914..a8adedffe 100644 --- a/tests/DocumentationExamplesTest.php +++ b/tests/DocumentationExamplesTest.php @@ -591,7 +591,7 @@ public function testExample_42_50(): void $this->assertCount(3, $documents); foreach ($documents as $document) { foreach (['_id', 'item', 'status', 'size', 'instock'] as $field) { - $this->assertObjectHasAttribute($field, $document); + $this->assertObjectHasProperty($field, $document); } } @@ -606,11 +606,11 @@ public function testExample_42_50(): void $this->assertCount(3, $documents); foreach ($documents as $document) { foreach (['_id', 'item', 'status'] as $field) { - $this->assertObjectHasAttribute($field, $document); + $this->assertObjectHasProperty($field, $document); } foreach (['size', 'instock'] as $field) { - $this->assertObjectNotHasAttribute($field, $document); + $this->assertObjectNotHasProperty($field, $document); } } @@ -625,11 +625,11 @@ public function testExample_42_50(): void $this->assertCount(3, $documents); foreach ($documents as $document) { foreach (['item', 'status'] as $field) { - $this->assertObjectHasAttribute($field, $document); + $this->assertObjectHasProperty($field, $document); } foreach (['_id', 'size', 'instock'] as $field) { - $this->assertObjectNotHasAttribute($field, $document); + $this->assertObjectNotHasProperty($field, $document); } } @@ -644,11 +644,11 @@ public function testExample_42_50(): void $this->assertCount(3, $documents); foreach ($documents as $document) { foreach (['_id', 'item', 'size'] as $field) { - $this->assertObjectHasAttribute($field, $document); + $this->assertObjectHasProperty($field, $document); } foreach (['status', 'instock'] as $field) { - $this->assertObjectNotHasAttribute($field, $document); + $this->assertObjectNotHasProperty($field, $document); } } @@ -663,13 +663,13 @@ public function testExample_42_50(): void $this->assertCount(3, $documents); foreach ($documents as $document) { foreach (['_id', 'item', 'status', 'size'] as $field) { - $this->assertObjectHasAttribute($field, $document); + $this->assertObjectHasProperty($field, $document); } - $this->assertObjectNotHasAttribute('instock', $document); - $this->assertObjectHasAttribute('uom', $document->size); - $this->assertObjectNotHasAttribute('h', $document->size); - $this->assertObjectNotHasAttribute('w', $document->size); + $this->assertObjectNotHasProperty('instock', $document); + $this->assertObjectHasProperty('uom', $document->size); + $this->assertObjectNotHasProperty('h', $document->size); + $this->assertObjectNotHasProperty('w', $document->size); } // Start Example 48 @@ -683,12 +683,12 @@ public function testExample_42_50(): void $this->assertCount(3, $documents); foreach ($documents as $document) { foreach (['_id', 'item', 'status', 'size', 'instock'] as $field) { - $this->assertObjectHasAttribute($field, $document); + $this->assertObjectHasProperty($field, $document); } - $this->assertObjectHasAttribute('h', $document->size); - $this->assertObjectHasAttribute('w', $document->size); - $this->assertObjectNotHasAttribute('uom', $document->size); + $this->assertObjectHasProperty('h', $document->size); + $this->assertObjectHasProperty('w', $document->size); + $this->assertObjectNotHasProperty('uom', $document->size); } // Start Example 49 @@ -702,13 +702,13 @@ public function testExample_42_50(): void $this->assertCount(3, $documents); foreach ($documents as $document) { foreach (['_id', 'item', 'status', 'instock'] as $field) { - $this->assertObjectHasAttribute($field, $document); + $this->assertObjectHasProperty($field, $document); } - $this->assertObjectNotHasAttribute('size', $document); + $this->assertObjectNotHasProperty('size', $document); foreach ($document->instock as $instock) { - $this->assertObjectHasAttribute('qty', $instock); - $this->assertObjectNotHasAttribute('warehouse', $instock); + $this->assertObjectHasProperty('qty', $instock); + $this->assertObjectNotHasProperty('warehouse', $instock); } } @@ -723,10 +723,10 @@ public function testExample_42_50(): void $this->assertCount(3, $documents); foreach ($documents as $document) { foreach (['_id', 'item', 'status', 'instock'] as $field) { - $this->assertObjectHasAttribute($field, $document); + $this->assertObjectHasProperty($field, $document); } - $this->assertObjectNotHasAttribute('size', $document); + $this->assertObjectNotHasProperty('size', $document); $this->assertCount(1, $document->instock); } } @@ -786,10 +786,10 @@ public function testAggregationProjectionExample_1(): void $this->assertCount(3, $documents); foreach ($documents as $document) { foreach (['item', 'status', 'area', 'reportNumber'] as $field) { - $this->assertObjectHasAttribute($field, $document); + $this->assertObjectHasProperty($field, $document); } - $this->assertObjectNotHasAttribute('_id', $document); + $this->assertObjectNotHasProperty('_id', $document); $this->assertIsString($document->status); $this->assertIsString($document->area); $this->assertSame(1, $document->reportNumber); diff --git a/tests/Operation/AggregateFunctionalTest.php b/tests/Operation/AggregateFunctionalTest.php index bd5ccee80..2b45b49c3 100644 --- a/tests/Operation/AggregateFunctionalTest.php +++ b/tests/Operation/AggregateFunctionalTest.php @@ -33,7 +33,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('allowDiskUse', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('allowDiskUse', $event['started']->getCommand()); }, ); } @@ -92,7 +92,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('readConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('readConcern', $event['started']->getCommand()); }, ); } @@ -111,7 +111,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('writeConcern', $event['started']->getCommand()); }, ); @@ -156,7 +156,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } @@ -218,14 +218,14 @@ function () use ($pipeline, $options): void { if (isset($result->shards)) { foreach ($result->shards as $shard) { - $this->assertObjectHasAttribute('stages', $shard); + $this->assertObjectHasProperty('stages', $shard); } } else { - $this->assertObjectHasAttribute('stages', $result); + $this->assertObjectHasProperty('stages', $result); } }, function (array $event): void { - $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('writeConcern', $event['started']->getCommand()); }, ); @@ -246,7 +246,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectHasProperty('bypassDocumentValidation', $event['started']->getCommand()); $this->assertEquals(true, $event['started']->getCommand()->bypassDocumentValidation); }, ); @@ -266,7 +266,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('bypassDocumentValidation', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/BulkWriteFunctionalTest.php b/tests/Operation/BulkWriteFunctionalTest.php index 46958e324..96006d689 100644 --- a/tests/Operation/BulkWriteFunctionalTest.php +++ b/tests/Operation/BulkWriteFunctionalTest.php @@ -379,7 +379,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } @@ -398,7 +398,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectHasProperty('bypassDocumentValidation', $event['started']->getCommand()); $this->assertEquals(true, $event['started']->getCommand()->bypassDocumentValidation); }, ); @@ -418,7 +418,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('bypassDocumentValidation', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/CountFunctionalTest.php b/tests/Operation/CountFunctionalTest.php index 47e9bea07..55435ab98 100644 --- a/tests/Operation/CountFunctionalTest.php +++ b/tests/Operation/CountFunctionalTest.php @@ -43,7 +43,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('readConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('readConcern', $event['started']->getCommand()); }, ); } @@ -99,7 +99,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/CreateCollectionFunctionalTest.php b/tests/Operation/CreateCollectionFunctionalTest.php index aa383f091..023a67e60 100644 --- a/tests/Operation/CreateCollectionFunctionalTest.php +++ b/tests/Operation/CreateCollectionFunctionalTest.php @@ -20,7 +20,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('writeConcern', $event['started']->getCommand()); }, ); } @@ -38,7 +38,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/CreateIndexesFunctionalTest.php b/tests/Operation/CreateIndexesFunctionalTest.php index 4204465d7..41e92bb44 100644 --- a/tests/Operation/CreateIndexesFunctionalTest.php +++ b/tests/Operation/CreateIndexesFunctionalTest.php @@ -162,7 +162,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('writeConcern', $event['started']->getCommand()); }, ); } @@ -181,7 +181,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } @@ -206,7 +206,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('commitQuorum', $event['started']->getCommand()); + $this->assertObjectHasProperty('commitQuorum', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/DatabaseCommandFunctionalTest.php b/tests/Operation/DatabaseCommandFunctionalTest.php index 4381718e8..6a1410669 100644 --- a/tests/Operation/DatabaseCommandFunctionalTest.php +++ b/tests/Operation/DatabaseCommandFunctionalTest.php @@ -55,7 +55,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/DeleteFunctionalTest.php b/tests/Operation/DeleteFunctionalTest.php index 44d96bda7..7ff002f97 100644 --- a/tests/Operation/DeleteFunctionalTest.php +++ b/tests/Operation/DeleteFunctionalTest.php @@ -115,7 +115,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/DistinctFunctionalTest.php b/tests/Operation/DistinctFunctionalTest.php index 625053bd9..4293293b0 100644 --- a/tests/Operation/DistinctFunctionalTest.php +++ b/tests/Operation/DistinctFunctionalTest.php @@ -50,7 +50,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('readConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('readConcern', $event['started']->getCommand()); }, ); } @@ -70,7 +70,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/DropCollectionFunctionalTest.php b/tests/Operation/DropCollectionFunctionalTest.php index 39b82a69f..602982f5c 100644 --- a/tests/Operation/DropCollectionFunctionalTest.php +++ b/tests/Operation/DropCollectionFunctionalTest.php @@ -21,7 +21,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('writeConcern', $event['started']->getCommand()); }, ); } @@ -67,7 +67,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/DropDatabaseFunctionalTest.php b/tests/Operation/DropDatabaseFunctionalTest.php index 6dd101a5d..628c3b0f3 100644 --- a/tests/Operation/DropDatabaseFunctionalTest.php +++ b/tests/Operation/DropDatabaseFunctionalTest.php @@ -24,7 +24,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('writeConcern', $event['started']->getCommand()); }, ); } @@ -69,7 +69,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/DropIndexesFunctionalTest.php b/tests/Operation/DropIndexesFunctionalTest.php index 1c3604159..d54c8544a 100644 --- a/tests/Operation/DropIndexesFunctionalTest.php +++ b/tests/Operation/DropIndexesFunctionalTest.php @@ -32,7 +32,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('writeConcern', $event['started']->getCommand()); }, ); } @@ -137,7 +137,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/ExplainFunctionalTest.php b/tests/Operation/ExplainFunctionalTest.php index 19b59dc5f..714a3f868 100644 --- a/tests/Operation/ExplainFunctionalTest.php +++ b/tests/Operation/ExplainFunctionalTest.php @@ -150,9 +150,9 @@ function () use ($operation): void { }, function (array $event): void { $command = $event['started']->getCommand(); - $this->assertObjectNotHasAttribute('maxAwaitTimeMS', $command->explain); - $this->assertObjectHasAttribute('tailable', $command->explain); - $this->assertObjectHasAttribute('awaitData', $command->explain); + $this->assertObjectNotHasProperty('maxAwaitTimeMS', $command->explain); + $this->assertObjectHasProperty('tailable', $command->explain); + $this->assertObjectHasProperty('awaitData', $command->explain); }, ); } @@ -175,8 +175,8 @@ function () use ($operation): void { }, function (array $event): void { $command = $event['started']->getCommand(); - $this->assertObjectHasAttribute('sort', $command->explain); - $this->assertObjectNotHasAttribute('modifiers', $command->explain); + $this->assertObjectHasProperty('sort', $command->explain); + $this->assertObjectNotHasProperty('modifiers', $command->explain); }, ); } @@ -261,7 +261,7 @@ function (): void { $result = $explainOperation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute( + $this->assertObjectHasProperty( 'bypassDocumentValidation', $event['started']->getCommand()->explain, ); @@ -288,7 +288,7 @@ function (): void { $result = $explainOperation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute( + $this->assertObjectNotHasProperty( 'bypassDocumentValidation', $event['started']->getCommand()->explain, ); diff --git a/tests/Operation/FindAndModifyFunctionalTest.php b/tests/Operation/FindAndModifyFunctionalTest.php index 05e819132..28c636d7c 100644 --- a/tests/Operation/FindAndModifyFunctionalTest.php +++ b/tests/Operation/FindAndModifyFunctionalTest.php @@ -104,7 +104,7 @@ function () use ($server): void { $operation->execute($server); }, function (array $event): void { - $this->assertObjectNotHasAttribute('readConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('readConcern', $event['started']->getCommand()); }, ); } @@ -122,7 +122,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('writeConcern', $event['started']->getCommand()); }, ); } @@ -191,7 +191,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } @@ -209,7 +209,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectHasProperty('bypassDocumentValidation', $event['started']->getCommand()); $this->assertEquals(true, $event['started']->getCommand()->bypassDocumentValidation); }, ); @@ -228,7 +228,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('bypassDocumentValidation', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/FindFunctionalTest.php b/tests/Operation/FindFunctionalTest.php index 2b70a421b..1238cec6e 100644 --- a/tests/Operation/FindFunctionalTest.php +++ b/tests/Operation/FindFunctionalTest.php @@ -82,7 +82,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('readConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('readConcern', $event['started']->getCommand()); }, ); } @@ -152,7 +152,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/InsertManyFunctionalTest.php b/tests/Operation/InsertManyFunctionalTest.php index ae17f7342..d4a786e71 100644 --- a/tests/Operation/InsertManyFunctionalTest.php +++ b/tests/Operation/InsertManyFunctionalTest.php @@ -132,7 +132,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } @@ -151,7 +151,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectHasProperty('bypassDocumentValidation', $event['started']->getCommand()); $this->assertEquals(true, $event['started']->getCommand()->bypassDocumentValidation); }, ); @@ -171,7 +171,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('bypassDocumentValidation', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/InsertOneFunctionalTest.php b/tests/Operation/InsertOneFunctionalTest.php index 2075f0fc0..d34a89df1 100644 --- a/tests/Operation/InsertOneFunctionalTest.php +++ b/tests/Operation/InsertOneFunctionalTest.php @@ -123,7 +123,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } @@ -142,7 +142,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectHasProperty('bypassDocumentValidation', $event['started']->getCommand()); $this->assertEquals(true, $event['started']->getCommand()->bypassDocumentValidation); }, ); @@ -162,7 +162,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('bypassDocumentValidation', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/ListCollectionNamesFunctionalTest.php b/tests/Operation/ListCollectionNamesFunctionalTest.php index 91f8b2fb7..74e188627 100644 --- a/tests/Operation/ListCollectionNamesFunctionalTest.php +++ b/tests/Operation/ListCollectionNamesFunctionalTest.php @@ -41,7 +41,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('authorizedCollections', $event['started']->getCommand()); + $this->assertObjectHasProperty('authorizedCollections', $event['started']->getCommand()); $this->assertSame(true, $event['started']->getCommand()->authorizedCollections); }, ); @@ -59,7 +59,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/ListCollectionsFunctionalTest.php b/tests/Operation/ListCollectionsFunctionalTest.php index ffdc3748c..9f03e14fe 100644 --- a/tests/Operation/ListCollectionsFunctionalTest.php +++ b/tests/Operation/ListCollectionsFunctionalTest.php @@ -86,7 +86,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('authorizedCollections', $event['started']->getCommand()); + $this->assertObjectHasProperty('authorizedCollections', $event['started']->getCommand()); $this->assertSame(true, $event['started']->getCommand()->authorizedCollections); }, ); @@ -104,7 +104,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/ListDatabaseNamesFunctionalTest.php b/tests/Operation/ListDatabaseNamesFunctionalTest.php index 651112afd..b9bbcc9a7 100644 --- a/tests/Operation/ListDatabaseNamesFunctionalTest.php +++ b/tests/Operation/ListDatabaseNamesFunctionalTest.php @@ -24,7 +24,7 @@ function () use (&$databases, $server): void { $databases = $operation->execute($server); }, function (array $event): void { - $this->assertObjectNotHasAttribute('authorizedDatabases', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('authorizedDatabases', $event['started']->getCommand()); $this->assertSame(true, $event['started']->getCommand()->nameOnly); }, ); @@ -45,7 +45,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('authorizedDatabases', $event['started']->getCommand()); + $this->assertObjectHasProperty('authorizedDatabases', $event['started']->getCommand()); $this->assertSame(true, $event['started']->getCommand()->authorizedDatabases); }, ); @@ -79,7 +79,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/ListDatabasesFunctionalTest.php b/tests/Operation/ListDatabasesFunctionalTest.php index 525b3d94e..0a6271827 100644 --- a/tests/Operation/ListDatabasesFunctionalTest.php +++ b/tests/Operation/ListDatabasesFunctionalTest.php @@ -26,7 +26,7 @@ function () use (&$databases, $server): void { $databases = $operation->execute($server); }, function (array $event): void { - $this->assertObjectNotHasAttribute('authorizedDatabases', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('authorizedDatabases', $event['started']->getCommand()); }, ); @@ -48,7 +48,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('authorizedDatabases', $event['started']->getCommand()); + $this->assertObjectHasProperty('authorizedDatabases', $event['started']->getCommand()); $this->assertSame(true, $event['started']->getCommand()->authorizedDatabases); }, ); @@ -86,7 +86,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/ListIndexesFunctionalTest.php b/tests/Operation/ListIndexesFunctionalTest.php index 553615e4d..dcdcac71c 100644 --- a/tests/Operation/ListIndexesFunctionalTest.php +++ b/tests/Operation/ListIndexesFunctionalTest.php @@ -55,7 +55,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/MapReduceFunctionalTest.php b/tests/Operation/MapReduceFunctionalTest.php index cc4084c71..ea1b1e70b 100644 --- a/tests/Operation/MapReduceFunctionalTest.php +++ b/tests/Operation/MapReduceFunctionalTest.php @@ -41,7 +41,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('readConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('readConcern', $event['started']->getCommand()); }, ); } @@ -66,7 +66,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('writeConcern', $event['started']->getCommand()); }, ); } @@ -161,7 +161,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } @@ -184,7 +184,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectHasProperty('bypassDocumentValidation', $event['started']->getCommand()); $this->assertEquals(true, $event['started']->getCommand()->bypassDocumentValidation); }, ); @@ -208,7 +208,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('bypassDocumentValidation', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/RenameCollectionFunctionalTest.php b/tests/Operation/RenameCollectionFunctionalTest.php index 05be70da7..9dccae0e3 100644 --- a/tests/Operation/RenameCollectionFunctionalTest.php +++ b/tests/Operation/RenameCollectionFunctionalTest.php @@ -46,7 +46,7 @@ function (): void { $operation->execute($server); }, function (array $event): void { - $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('writeConcern', $event['started']->getCommand()); }, ); } @@ -138,7 +138,7 @@ function (): void { $operation->execute($server); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/UpdateFunctionalTest.php b/tests/Operation/UpdateFunctionalTest.php index e70331433..d475866ce 100644 --- a/tests/Operation/UpdateFunctionalTest.php +++ b/tests/Operation/UpdateFunctionalTest.php @@ -102,7 +102,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('lsid', $event['started']->getCommand()); + $this->assertObjectHasProperty('lsid', $event['started']->getCommand()); }, ); } @@ -122,7 +122,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectHasProperty('bypassDocumentValidation', $event['started']->getCommand()); $this->assertEquals(true, $event['started']->getCommand()->bypassDocumentValidation); }, ); @@ -143,7 +143,7 @@ function (): void { $operation->execute($this->getPrimaryServer()); }, function (array $event): void { - $this->assertObjectNotHasAttribute('bypassDocumentValidation', $event['started']->getCommand()); + $this->assertObjectNotHasProperty('bypassDocumentValidation', $event['started']->getCommand()); }, ); } diff --git a/tests/Operation/WatchFunctionalTest.php b/tests/Operation/WatchFunctionalTest.php index a7e0ae534..c71818cf2 100644 --- a/tests/Operation/WatchFunctionalTest.php +++ b/tests/Operation/WatchFunctionalTest.php @@ -97,7 +97,7 @@ public function encode($value): Document yield 'Codec' => [ 'options' => ['codec' => $codec], 'getIdentifier' => static function (object $document): object { - self::assertObjectHasAttribute('id', $document); + self::assertObjectHasProperty('id', $document); return $document->id; }, @@ -322,11 +322,11 @@ function (array $event) use (&$events): void { private function assertResumeAfter($expectedResumeToken, stdClass $command): void { - $this->assertObjectHasAttribute('pipeline', $command); + $this->assertObjectHasProperty('pipeline', $command); $this->assertIsArray($command->pipeline); $this->assertArrayHasKey(0, $command->pipeline); - $this->assertObjectHasAttribute('$changeStream', $command->pipeline[0]); - $this->assertObjectHasAttribute('resumeAfter', $command->pipeline[0]->{'$changeStream'}); + $this->assertObjectHasProperty('$changeStream', $command->pipeline[0]); + $this->assertObjectHasProperty('resumeAfter', $command->pipeline[0]->{'$changeStream'}); $this->assertEquals($expectedResumeToken, $command->pipeline[0]->{'$changeStream'}->resumeAfter); } @@ -355,7 +355,7 @@ function (array $event) use (&$events): void { $this->assertCount(1, $events); $this->assertSame('aggregate', $events[0]['started']->getCommandName()); $reply = $events[0]['succeeded']->getReply(); - $this->assertObjectHasAttribute('operationTime', $reply); + $this->assertObjectHasProperty('operationTime', $reply); $operationTime = $reply->operationTime; $this->assertInstanceOf(TimestampInterface::class, $operationTime); @@ -395,11 +395,11 @@ function (array $event) use (&$events): void { private function assertStartAtOperationTime(TimestampInterface $expectedOperationTime, stdClass $command): void { - $this->assertObjectHasAttribute('pipeline', $command); + $this->assertObjectHasProperty('pipeline', $command); $this->assertIsArray($command->pipeline); $this->assertArrayHasKey(0, $command->pipeline); - $this->assertObjectHasAttribute('$changeStream', $command->pipeline[0]); - $this->assertObjectHasAttribute('startAtOperationTime', $command->pipeline[0]->{'$changeStream'}); + $this->assertObjectHasProperty('$changeStream', $command->pipeline[0]); + $this->assertObjectHasProperty('startAtOperationTime', $command->pipeline[0]->{'$changeStream'}); $this->assertEquals($expectedOperationTime, $command->pipeline[0]->{'$changeStream'}->startAtOperationTime); } @@ -1454,7 +1454,7 @@ public function testResumeTokenBehaviour(array $options): void $this->assertInstanceOf(CommandSucceededEvent::class, $event['succeeded']); $reply = $event['succeeded']->getReply(); - $this->assertObjectHasAttribute('operationTime', $reply); + $this->assertObjectHasProperty('operationTime', $reply); $lastOpTime = $reply->operationTime; }); @@ -1544,8 +1544,8 @@ function (array $event) use (&$aggregateCommand): void { ); $this->assertNotNull($aggregateCommand); - $this->assertObjectNotHasAttribute('resumeAfter', $aggregateCommand->pipeline[0]->{'$changeStream'}); - $this->assertObjectHasAttribute('startAfter', $aggregateCommand->pipeline[0]->{'$changeStream'}); + $this->assertObjectNotHasProperty('resumeAfter', $aggregateCommand->pipeline[0]->{'$changeStream'}); + $this->assertObjectHasProperty('startAfter', $aggregateCommand->pipeline[0]->{'$changeStream'}); } /** @@ -1593,8 +1593,8 @@ function (array $event) use (&$aggregateCommand): void { ); $this->assertNotNull($aggregateCommand); - $this->assertObjectNotHasAttribute('startAfter', $aggregateCommand->pipeline[0]->{'$changeStream'}); - $this->assertObjectHasAttribute('resumeAfter', $aggregateCommand->pipeline[0]->{'$changeStream'}); + $this->assertObjectNotHasProperty('startAfter', $aggregateCommand->pipeline[0]->{'$changeStream'}); + $this->assertObjectHasProperty('resumeAfter', $aggregateCommand->pipeline[0]->{'$changeStream'}); } private function assertNoCommandExecuted(callable $callable): void @@ -1626,9 +1626,9 @@ private function forceChangeStreamResume(): void private function getPostBatchResumeTokenFromReply(stdClass $reply) { - $this->assertObjectHasAttribute('cursor', $reply); + $this->assertObjectHasProperty('cursor', $reply); $this->assertIsObject($reply->cursor); - $this->assertObjectHasAttribute('postBatchResumeToken', $reply->cursor); + $this->assertObjectHasProperty('postBatchResumeToken', $reply->cursor); $this->assertIsObject($reply->cursor->postBatchResumeToken); return $reply->cursor->postBatchResumeToken; diff --git a/tests/SpecTests/AtlasDataLakeSpecTest.php b/tests/SpecTests/AtlasDataLakeSpecTest.php index 15f45434c..3d008093c 100644 --- a/tests/SpecTests/AtlasDataLakeSpecTest.php +++ b/tests/SpecTests/AtlasDataLakeSpecTest.php @@ -44,11 +44,11 @@ function (array $event) use (&$cursorId, &$cursorNamespace): void { $this->assertArrayHasKey('succeeded', $event); $reply = $event['succeeded']->getReply(); - $this->assertObjectHasAttribute('cursor', $reply); + $this->assertObjectHasProperty('cursor', $reply); $this->assertIsObject($reply->cursor); - $this->assertObjectHasAttribute('id', $reply->cursor); + $this->assertObjectHasProperty('id', $reply->cursor); $this->assertIsInt($reply->cursor->id); - $this->assertObjectHasAttribute('ns', $reply->cursor); + $this->assertObjectHasProperty('ns', $reply->cursor); $this->assertIsString($reply->cursor->ns); /* Note: MongoDB\Driver\CursorId is not used here; however, @@ -74,9 +74,9 @@ function (array $event) use (&$cursorId, &$cursorNamespace): void { * cursor ID from the find command reply. */ $this->assertSame($databaseName, $event['started']->getDatabaseName()); $this->assertSame($databaseName, $command->{'$db'}); - $this->assertObjectHasAttribute('killCursors', $command); + $this->assertObjectHasProperty('killCursors', $command); $this->assertSame($collectionName, $command->killCursors); - $this->assertObjectHasAttribute('cursors', $command); + $this->assertObjectHasProperty('cursors', $command); $this->assertIsArray($command->cursors); $this->assertArrayHasKey(0, $command->cursors); $this->assertSame($cursorId, $command->cursors[0]); @@ -84,7 +84,7 @@ function (array $event) use (&$cursorId, &$cursorNamespace): void { /* Assert that the killCursors command reply indicates that the * expected cursor ID was killed. */ $reply = $event['succeeded']->getReply(); - $this->assertObjectHasAttribute('cursorsKilled', $reply); + $this->assertObjectHasProperty('cursorsKilled', $reply); $this->assertIsArray($reply->cursorsKilled); $this->assertArrayHasKey(0, $reply->cursorsKilled); $this->assertSame($cursorId, $reply->cursorsKilled[0]); diff --git a/tests/SpecTests/ClientSideEncryptionSpecTest.php b/tests/SpecTests/ClientSideEncryptionSpecTest.php index 001d78a84..1c716edb0 100644 --- a/tests/SpecTests/ClientSideEncryptionSpecTest.php +++ b/tests/SpecTests/ClientSideEncryptionSpecTest.php @@ -340,8 +340,8 @@ function ($command) use (&$insertCommand): void { $this->assertSame(Binary::TYPE_UUID, $dataKeyId->getType()); $this->assertNotNull($insertCommand); - $this->assertObjectHasAttribute('writeConcern', $insertCommand); - $this->assertObjectHasAttribute('w', $insertCommand->writeConcern); + $this->assertObjectHasProperty('writeConcern', $insertCommand); + $this->assertObjectHasProperty('w', $insertCommand->writeConcern); $this->assertSame(WriteConcern::MAJORITY, $insertCommand->writeConcern->w); $keys = $client->selectCollection('keyvault', 'datakeys')->find(['_id' => $dataKeyId]); @@ -1559,10 +1559,10 @@ static function (self $test, Client $client, ClientEncryption $clientEncryption) $keyId = $clientEncryption->createDataKey('local'); $keyBeforeUpdate = $clientEncryption->addKeyAltName($keyId, 'abc'); - $test->assertObjectNotHasAttribute('keyAltNames', $keyBeforeUpdate); + $test->assertObjectNotHasProperty('keyAltNames', $keyBeforeUpdate); $keyBeforeUpdate = $clientEncryption->addKeyAltName($keyId, 'abc'); - $test->assertObjectHasAttribute('keyAltNames', $keyBeforeUpdate); + $test->assertObjectHasProperty('keyAltNames', $keyBeforeUpdate); $test->assertIsArray($keyBeforeUpdate->keyAltNames); $test->assertContains('abc', $keyBeforeUpdate->keyAltNames); @@ -1576,7 +1576,7 @@ static function (self $test, Client $client, ClientEncryption $clientEncryption) $originalKeyId = $clientEncryption->getKeyByAltName('def')->_id; $originalKeyBeforeUpdate = $clientEncryption->addKeyAltName($originalKeyId, 'def'); - $test->assertObjectHasAttribute('keyAltNames', $originalKeyBeforeUpdate); + $test->assertObjectHasProperty('keyAltNames', $originalKeyBeforeUpdate); $test->assertIsArray($originalKeyBeforeUpdate->keyAltNames); $test->assertContains('def', $originalKeyBeforeUpdate->keyAltNames); }, @@ -1832,10 +1832,10 @@ public function testRewrapManyDataKey(string $srcProvider, string $dstProvider): $result = $clientEncryption2->rewrapManyDataKey([], $rewrapManyDataKeyOpts); - $this->assertObjectHasAttribute('bulkWriteResult', $result); + $this->assertObjectHasProperty('bulkWriteResult', $result); $this->assertIsObject($result->bulkWriteResult); // libmongoc uses different field names for its BulkWriteResult - $this->assertObjectHasAttribute('nModified', $result->bulkWriteResult); + $this->assertObjectHasProperty('nModified', $result->bulkWriteResult); $this->assertSame(1, $result->bulkWriteResult->nModified); $this->assertSame('test', $clientEncryption1->decrypt($ciphertext)); diff --git a/tests/SpecTests/ErrorExpectation.php b/tests/SpecTests/ErrorExpectation.php index 82511b4d6..cc10dcba9 100644 --- a/tests/SpecTests/ErrorExpectation.php +++ b/tests/SpecTests/ErrorExpectation.php @@ -163,13 +163,13 @@ private function assertCodeName(TestCase $test, ?Throwable $actual = null): void $result = $actual->getResultDocument(); if (isset($result->writeConcernError)) { - $test->assertObjectHasAttribute('codeName', $result->writeConcernError); + $test->assertObjectHasProperty('codeName', $result->writeConcernError); $test->assertSame($this->codeName, $result->writeConcernError->codeName); return; } - $test->assertObjectHasAttribute('codeName', $result); + $test->assertObjectHasProperty('codeName', $result); $test->assertSame($this->codeName, $result->codeName); } diff --git a/tests/SpecTests/FunctionalTestCase.php b/tests/SpecTests/FunctionalTestCase.php index b4ca35a9e..ce2b815d5 100644 --- a/tests/SpecTests/FunctionalTestCase.php +++ b/tests/SpecTests/FunctionalTestCase.php @@ -104,7 +104,7 @@ protected static function assertCommandOmittedFields(stdClass $expected, stdClas { foreach ($expected as $key => $value) { if ($value === null) { - static::assertObjectNotHasAttribute($key, $actual); + static::assertObjectNotHasProperty($key, $actual); unset($expected->{$key}); } } diff --git a/tests/UnifiedSpecTests/EventObserver.php b/tests/UnifiedSpecTests/EventObserver.php index cd2f44d24..767216643 100644 --- a/tests/UnifiedSpecTests/EventObserver.php +++ b/tests/UnifiedSpecTests/EventObserver.php @@ -27,7 +27,7 @@ use function PHPUnit\Framework\assertIsObject; use function PHPUnit\Framework\assertIsString; use function PHPUnit\Framework\assertNotEmpty; -use function PHPUnit\Framework\assertObjectHasAttribute; +use function PHPUnit\Framework\assertObjectHasProperty; use function PHPUnit\Framework\assertSame; use function PHPUnit\Framework\assertThat; use function sprintf; @@ -165,7 +165,7 @@ public function getLsidsOnLastTwoCommands(): array } $command = $event->getCommand(); - assertObjectHasAttribute('lsid', $command); + assertObjectHasProperty('lsid', $command); $lsids[] = $command->lsid; if (count($lsids) === 2) { diff --git a/tests/UnifiedSpecTests/ExpectedError.php b/tests/UnifiedSpecTests/ExpectedError.php index 52fc1f91c..06cd2c902 100644 --- a/tests/UnifiedSpecTests/ExpectedError.php +++ b/tests/UnifiedSpecTests/ExpectedError.php @@ -26,7 +26,7 @@ use function PHPUnit\Framework\assertNotInstanceOf; use function PHPUnit\Framework\assertNotNull; use function PHPUnit\Framework\assertNull; -use function PHPUnit\Framework\assertObjectHasAttribute; +use function PHPUnit\Framework\assertObjectHasProperty; use function PHPUnit\Framework\assertSame; use function PHPUnit\Framework\assertStringContainsStringIgnoringCase; use function PHPUnit\Framework\assertThat; @@ -218,13 +218,13 @@ private function assertCodeName(ServerException $e): void $result = $e->getResultDocument(); if (isset($result->writeConcernError)) { - assertObjectHasAttribute('codeName', $result->writeConcernError); + assertObjectHasProperty('codeName', $result->writeConcernError); assertSame($this->codeName, $result->writeConcernError->codeName); return; } - assertObjectHasAttribute('codeName', $result); + assertObjectHasProperty('codeName', $result); assertSame($this->codeName, $result->codeName); } } diff --git a/tests/UnifiedSpecTests/Operation.php b/tests/UnifiedSpecTests/Operation.php index 4c916ffa4..68383443e 100644 --- a/tests/UnifiedSpecTests/Operation.php +++ b/tests/UnifiedSpecTests/Operation.php @@ -51,7 +51,7 @@ use function PHPUnit\Framework\assertNotEquals; use function PHPUnit\Framework\assertNotNull; use function PHPUnit\Framework\assertNull; -use function PHPUnit\Framework\assertObjectHasAttribute; +use function PHPUnit\Framework\assertObjectHasProperty; use function PHPUnit\Framework\assertSame; use function PHPUnit\Framework\assertThat; use function PHPUnit\Framework\assertTrue; @@ -535,7 +535,7 @@ private function executeForCollection(Collection $collection) case 'createSearchIndex': assertArrayHasKey('model', $args); assertIsObject($args['model']); - assertObjectHasAttribute('definition', $args['model']); + assertObjectHasProperty('definition', $args['model']); assertInstanceOf(stdClass::class, $args['model']->definition); /* Note: tests specify options within "model". A top-level @@ -1050,7 +1050,7 @@ private static function prepareUploadArguments(array $args): array { $source = $args['source'] ?? null; assertIsObject($source); - assertObjectHasAttribute('$$hexBytes', $source); + assertObjectHasProperty('$$hexBytes', $source); Util::assertHasOnlyKeys($source, ['$$hexBytes']); $hexBytes = $source->{'$$hexBytes'}; assertIsString($hexBytes);