phpcr/phpcr-api-tests — pull request #120 by lsmith77 (2013-10-09 15:32:25+00:00)
Title: Date querying

supersedes #95

would require something like to make the tests pass:
```
diff --git a/src/PHPCR/Util/QOM/Sql2ToQomQueryConverter.php b/src/PHPCR/Util/QOM/Sql2ToQomQueryConverter.php
index dc26ade..b80d90c 100644
--- a/src/PHPCR/Util/QOM/Sql2ToQomQueryConverter.php
+++ b/src/PHPCR/Util/QOM/Sql2ToQomQueryConverter.php
@@ -755,6 +755,13 @@ class Sql2ToQomQueryConverter
}
$token = substr($token, 1, -1);
$token = str_replace('\\'.$quoteString, $quoteString, $token);
+ if (preg_match('/^\d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d+)?$/', $token)) {
+ if (preg_match('/^\d{4}-\d{2}-\d{2}$/', $token)) {
+ $token.= ' 00:00:00';
+ }
+ $token = \DateTime::createFromFormat('Y-m-d H:i:s', $token);
+ }
+
} elseif (is_numeric($token)) {
$token = strpos($token, '.') === false ? (int) $token : (float) $token;
} elseif ($token == 'true') {
```

then again maybe its not necessary and we actually need to improve the test setup to be more flexible to deal with:
```

1) PHPCR\Tests\Query\QOM\Sql2ToQomConverterTest::testQueries
Original query = SELECT * FROM [nt:unstructured] AS sel WHERE sel.prop > '2013-04-15'
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
'operand2' => Jackalope\Query\QOM\Literal Object (
- 'literalValue' => DateTime Object (...)
+ 'literalValue' => '2013-04-15'
```