Skip to content

Commit b850e3e

Browse files
committed
Merge pull request #136 from phpcr/fulltext_tests
expanded test coverage for fulltext search
2 parents 72ce0d0 + 6405933 commit b850e3e

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

tests/06_Query/QOM/QomTestQueries.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,18 @@ public static function getQueries(\PHPCR\Query\QOM\QueryObjectModelFactoryInterf
338338
*/
339339

340340
// SELECT * FROM nt:file WHERE CONTAINS(sel.prop, expr)
341-
// TODO: NOT YET IMPLEMENTED
342-
// $queries['6.7.19.FullTextSearch'] =
343-
// $factory->createQuery(
344-
// $factory->selector('nt:file'),
345-
// $factory->fullTextSearch('prop', 'expr', 'sel'),
346-
// array(),
347-
// array());
341+
$queries['6.7.19.FullTextSearch'] =
342+
$factory->createQuery(
343+
$factory->selector('file', 'nt:file'),
344+
$factory->fullTextSearch('file', 'prop', 'expr'),
345+
array(),
346+
array());
347+
$queries['6.7.19.FullTextSearch_With_Single_Quote'] =
348+
$factory->createQuery(
349+
$factory->selector('file', 'nt:file'),
350+
$factory->fullTextSearch('file', 'prop', "expr'"),
351+
array(),
352+
array());
348353

349354
/**
350355
* 6.7.20. SameNode

tests/06_Query/QOM/Sql2TestQueries.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public static function getQueries()
115115
* 6.7.19. FullTextSearch
116116
*/
117117
$queries['6.7.19.FullTextSearch'] = 'SELECT * FROM [nt:file] AS file WHERE CONTAINS(file.prop, \'expr\')';
118+
$queries['6.7.19.FullTextSearch_With_Single_Quote'] = "SELECT * FROM [nt:file] AS file WHERE CONTAINS(file.prop, 'expr''')";
118119

119120
/**
120121
* 6.7.20. SameNode

0 commit comments

Comments
 (0)