File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1212namespace PHPCR \Tests \Query ;
1313
1414use PHPCR \Query \QueryInterface ;
15+ use PHPCR \Query \RowInterface ;
1516
1617/**
1718 * Run non-trivial queries to try out where, the join features and such.
@@ -46,6 +47,26 @@ public function testQueryField()
4647 $ this ->assertEquals (array ('bar ' ), $ vals );
4748 }
4849
50+ public function testQueryFieldDate ()
51+ {
52+ /** @var $query QueryInterface */
53+ $ query = $ this ->sharedFixture ['qm ' ]->createQuery ("
54+ SELECT *
55+ FROM [nt:base]
56+ WHERE [mydateprop] <= CAST('2011-04-27T13:01:07.472+02:00' AS DATE)
57+ AND [mydateprop] >= CAST('2011-04-01T13:01:07.472+02:00' AS DATE)
58+ AND (ISSAMENODE([/tests_general_base]) OR ISDESCENDANTNODE([/tests_general_base]))
59+ " ,
60+ QueryInterface::JCR_SQL2
61+ );
62+
63+ $ result = $ query ->execute ();
64+ $ this ->assertCount (1 , $ result ->getRows ());
65+ /** @var RowInterface $row */
66+ $ row = $ result ->getRows ()->current ();
67+ $ this ->assertEquals ('/tests_general_base/index.txt/jcr:content ' , $ row ->getPath ());
68+ }
69+
4970 public function testQueryFieldSomeNull ()
5071 {
5172 /** @var $query QueryInterface */
You can’t perform that action at this time.
0 commit comments