Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
This tests started to fail with the 1.14 version of the driver
  • Loading branch information
franmomu committed Jul 17, 2022
1 parent 8f968ba commit c11de01
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/en/cookbook/validation-of-documents.rst
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": { "$regex": "@mongodb\\.com$" } },
{ "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": { "$regex": "@mongodb\\.com$" } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/annotations-reference.rst
Expand Up @@ -1186,7 +1186,7 @@ for the related collection.
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regex": "@mongodb\\.com$" } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down
Expand Up @@ -36,7 +36,7 @@ public function testCreateUpdateValidatedDocument(): void
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regex": "@mongodb\\.com$" } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down
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": { "$regex": "@mongodb\\\\.com$" } } ] }';
$cm->setValidator(toPHP(fromJSON($validatorJson)));
$cm->setValidationAction(ClassMetadata::SCHEMA_VALIDATION_ACTION_WARN);
$cm->setValidationLevel(ClassMetadata::SCHEMA_VALIDATION_LEVEL_OFF);
Expand Down
Expand Up @@ -132,7 +132,7 @@ public function testValidationMapping(): void
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regex": "@mongodb\\.com$" } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down
Expand Up @@ -18,7 +18,7 @@
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regex": "@mongodb\\.com$" } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/ODM/MongoDB/Tests/SchemaManagerTest.php
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": { "$regex": "@mongodb\\.com$" } },
{ "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": { "$regex": "@mongodb\\.com$" } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Documents/SchemaValidated.php
Expand Up @@ -30,7 +30,7 @@ class SchemaValidated
},
"$or": [
{ "phone": { "$type": "string" } },
{ "email": { "$regex": { "$regularExpression" : { "pattern": "@mongodb\\.com$", "options": "" } } } },
{ "email": { "$regex": "@mongodb\\.com$" } },
{ "status": { "$in": [ "Unknown", "Incomplete" ] } }
]
}
Expand Down

0 comments on commit c11de01

Please sign in to comment.