$sql = '(search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)) '
. 'AND (search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?))';
$sql='search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?) '
.'AND search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)';
$this->assertEqual($ret,$sql);
}
...
...
@@ -123,9 +74,7 @@ class Doctrine_Search_Query_TestCase extends Doctrine_UnitTestCase
$q=newDoctrine_Search_Query('SearchTestIndex');
$ret=$q->parseClause('((doctrine OR orm) AND dbal) OR database');
$sql = '(search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ? OR keyword = ?)) '
. 'AND (search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?))'
. ' OR keyword = ?';
$sql='(search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ? OR keyword = ?) AND search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)) OR keyword = ?';
$this->assertEqual($ret,$sql);
}
...
...
@@ -135,8 +84,7 @@ class Doctrine_Search_Query_TestCase extends Doctrine_UnitTestCase
$q=newDoctrine_Search_Query('SearchTestIndex');
$ret=$q->parseClause('doctrine OR orm AND dbal');
$sql = '(search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ? OR keyword = ?)) '
. 'AND (search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?))';
$sql='keyword = ? OR search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?) AND search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)';
$this->assertEqual($ret,$sql);
}
...
...
@@ -146,8 +94,7 @@ class Doctrine_Search_Query_TestCase extends Doctrine_UnitTestCase
$q=newDoctrine_Search_Query('SearchTestIndex');
$ret=$q->parseClause('(doctrine OR orm) AND dbal');
$sql = '(search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ? OR keyword = ?)) '
. 'AND (search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?))';
$sql='search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ? OR keyword = ?) AND search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)';
$this->assertEqual($ret,$sql);
}
...
...
@@ -157,8 +104,7 @@ class Doctrine_Search_Query_TestCase extends Doctrine_UnitTestCase
$q=newDoctrine_Search_Query('SearchTestIndex');
$ret=$q->parseClause('(doctrine OR orm) dbal');
$sql = '(search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ? OR keyword = ?)) '
. 'AND (search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?))';
$sql='search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ? OR keyword = ?) AND search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)';
$this->assertEqual($ret,$sql);
}
...
...
@@ -168,21 +114,27 @@ class Doctrine_Search_Query_TestCase extends Doctrine_UnitTestCase
$q=newDoctrine_Search_Query('SearchTestIndex');
$ret=$q->parseClause('(((doctrine OR orm) AND dbal) OR database) AND rdbms');
$sql = '((search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ? OR keyword = ?)) '
. 'AND (search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?))'
. ' OR keyword = ?) AND (search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?))';
$sql='((search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ? OR keyword = ?) AND search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)) OR keyword = ?) AND search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)';
$sql='search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?) AND search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ? OR keyword = ?)';
$ret=$q->parseClause('rdbms (((doctrine OR orm) AND dbal) OR database)');
$sql = '(search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)) AND '
. '((search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ? OR keyword = ?)) '
. 'AND (search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?))'
. ' OR keyword = ?)';
$sql='search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?) AND ((search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ? OR keyword = ?) AND search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)) OR keyword = ?)';
$this->assertEqual($ret,$sql);
}
...
...
@@ -192,33 +144,36 @@ class Doctrine_Search_Query_TestCase extends Doctrine_UnitTestCase
$q=newDoctrine_Search_Query('SearchTestIndex');
$ret=$q->parseClause('rdbms -doctrine');
$sql = '(search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)) AND '
. '(search_test_id NOT IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?))';
$sql='search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?) AND '
.'search_test_id NOT IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)';
$this->assertEqual($ret,$sql);
}
publicfunctiontestParseClauseOrOperator2()
{
$q=newDoctrine_Search_Query('SearchTestIndex');
$ret=$q->parseClause('rdbms doctrine OR database');
$sql = '(search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)) AND '
. '(search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?)) '
$sql='search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?) AND '
.'search_test_id IN (SELECT search_test_id FROM search_test_index WHERE keyword = ?) '