Skip to content

Commit

Permalink
Merge pull request #2452 from franmomu/fix_tests
Browse files Browse the repository at this point in the history
Fix failing tests
  • Loading branch information
malarzm authored Sep 19, 2022
2 parents 8f968ba + 6c7d3b7 commit 89a5bfd
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 33 deletions.
4 changes: 2 additions & 2 deletions docs/en/cookbook/validation-of-documents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ the ``odm:schema:create`` or ``odm:schema:update`` command.
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down Expand Up @@ -241,7 +241,7 @@ the ``odm:schema:create`` or ``odm:schema:update`` command.
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/annotations-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ for the related collection.
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function testCreateUpdateValidatedDocument(): void
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function testClassMetadataInstanceSerialization(): void
$cm->setLockField('lock');
$cm->setVersioned(true);
$cm->setVersionField('version');
$validatorJson = '{ "$and": [ { "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\\\.com$", "options": "" } } } } ] }';
$validatorJson = '{ "$and": [ { "email": { "$regularExpression" : { "pattern": "@mongodb\\\\.com$", "options": "" } } } ] }';
$cm->setValidator(toPHP(fromJSON($validatorJson)));
$cm->setValidationAction(ClassMetadata::SCHEMA_VALIDATION_ACTION_WARN);
$cm->setValidationLevel(ClassMetadata::SCHEMA_VALIDATION_LEVEL_OFF);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function testValidationMapping(): void
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/ODM/MongoDB/Tests/SchemaManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public function testUpdateDocumentValidator(array $expectedWriteOptions, ?int $m
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down Expand Up @@ -543,7 +543,7 @@ public function testCreateDocumentCollectionWithValidator(array $expectedWriteOp
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Documents/SchemaValidated.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SchemaValidated
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down

0 comments on commit 89a5bfd

Please sign in to comment.