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