Skip to content

Commit fca04ae

Browse files
committed
PHPLIB-494: Test against null for options with default values
1 parent 98fcbea commit fca04ae

12 files changed

+56
-37
lines changed

tests/ClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function provideInvalidConstructorDriverOptions()
3333
{
3434
$options = [];
3535

36-
foreach ($this->getInvalidArrayValues() as $value) {
36+
foreach ($this->getInvalidArrayValues(true) as $value) {
3737
$options[][] = ['typeMap' => $value];
3838
}
3939

tests/GridFS/BucketFunctionalTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ public function provideInvalidConstructorOptions()
6262
{
6363
$options = [];
6464

65-
foreach ($this->getInvalidStringValues() as $value) {
65+
foreach ($this->getInvalidStringValues(true) as $value) {
6666
$options[][] = ['bucketName' => $value];
6767
}
6868

69-
foreach ($this->getInvalidIntegerValues() as $value) {
69+
foreach ($this->getInvalidIntegerValues(true) as $value) {
7070
$options[][] = ['chunkSizeBytes' => $value];
7171
}
7272

73-
foreach ($this->getInvalidBooleanValues() as $value) {
73+
foreach ($this->getInvalidBooleanValues(true) as $value) {
7474
$options[][] = ['disableMD5' => $value];
7575
}
7676

tests/GridFS/WritableStreamFunctionalTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ public function provideInvalidConstructorOptions()
5050
{
5151
$options = [];
5252

53-
foreach ($this->getInvalidIntegerValues() as $value) {
53+
foreach ($this->getInvalidIntegerValues(true) as $value) {
5454
$options[][] = ['chunkSizeBytes' => $value];
5555
}
5656

57-
foreach ($this->getInvalidBooleanValues() as $value) {
57+
foreach ($this->getInvalidBooleanValues(true) as $value) {
5858
$options[][] = ['disableMD5' => $value];
5959
}
6060

tests/Operation/AggregateTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function provideInvalidConstructorOptions()
2727
{
2828
$options = [];
2929

30-
foreach ($this->getInvalidBooleanValues() as $value) {
30+
foreach ($this->getInvalidBooleanValues(true) as $value) {
3131
$options[][] = ['allowDiskUse' => $value];
3232
}
3333

@@ -79,7 +79,7 @@ public function provideInvalidConstructorOptions()
7979
$options[][] = ['typeMap' => $value];
8080
}
8181

82-
foreach ($this->getInvalidBooleanValues() as $value) {
82+
foreach ($this->getInvalidBooleanValues(true) as $value) {
8383
$options[][] = ['useCursor' => $value];
8484
}
8585

tests/Operation/BulkWriteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ public function provideInvalidConstructorOptions()
412412
$options[][] = ['bypassDocumentValidation' => $value];
413413
}
414414

415-
foreach ($this->getInvalidBooleanValues() as $value) {
415+
foreach ($this->getInvalidBooleanValues(true) as $value) {
416416
$options[][] = ['ordered' => $value];
417417
}
418418

tests/Operation/FindAndModifyTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ public function provideInvalidConstructorOptions()
4040
$options[][] = ['maxTimeMS' => $value];
4141
}
4242

43-
foreach ($this->getInvalidBooleanValues() as $value) {
43+
foreach ($this->getInvalidBooleanValues(true) as $value) {
4444
$options[][] = ['new' => $value];
4545
}
4646

4747
foreach ($this->getInvalidDocumentValues() as $value) {
4848
$options[][] = ['query' => $value];
4949
}
5050

51-
foreach ($this->getInvalidBooleanValues() as $value) {
51+
foreach ($this->getInvalidBooleanValues(true) as $value) {
5252
$options[][] = ['remove' => $value];
5353
}
5454

@@ -68,7 +68,7 @@ public function provideInvalidConstructorOptions()
6868
$options[][] = ['update' => $value];
6969
}
7070

71-
foreach ($this->getInvalidBooleanValues() as $value) {
71+
foreach ($this->getInvalidBooleanValues(true) as $value) {
7272
$options[][] = ['upsert' => $value];
7373
}
7474

tests/Operation/FindOneAndReplaceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function provideInvalidConstructorOptions()
4949
$options[][] = ['projection' => $value];
5050
}
5151

52-
foreach ($this->getInvalidIntegerValues() as $value) {
52+
foreach ($this->getInvalidIntegerValues(true) as $value) {
5353
$options[][] = ['returnDocument' => $value];
5454
}
5555

tests/Operation/FindOneAndUpdateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function provideInvalidConstructorOptions()
4949
$options[][] = ['projection' => $value];
5050
}
5151

52-
foreach ($this->getInvalidIntegerValues() as $value) {
52+
foreach ($this->getInvalidIntegerValues(true) as $value) {
5353
$options[][] = ['returnDocument' => $value];
5454
}
5555

tests/Operation/InsertManyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function provideInvalidConstructorOptions()
4848
$options[][] = ['bypassDocumentValidation' => $value];
4949
}
5050

51-
foreach ($this->getInvalidBooleanValues() as $value) {
51+
foreach ($this->getInvalidBooleanValues(true) as $value) {
5252
$options[][] = ['ordered' => $value];
5353
}
5454

tests/Operation/UpdateTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ public function provideInvalidConstructorOptions()
5252
$options[][] = ['collation' => $value];
5353
}
5454

55-
foreach ($this->getInvalidBooleanValues() as $value) {
55+
foreach ($this->getInvalidBooleanValues(true) as $value) {
5656
$options[][] = ['multi' => $value];
5757
}
5858

5959
foreach ($this->getInvalidSessionValues() as $value) {
6060
$options[][] = ['session' => $value];
6161
}
6262

63-
foreach ($this->getInvalidBooleanValues() as $value) {
63+
foreach ($this->getInvalidBooleanValues(true) as $value) {
6464
$options[][] = ['upsert' => $value];
6565
}
6666

0 commit comments

Comments
 (0)