mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Add unit test + 통합검색 키워드 글자 수 제한 변경
This commit is contained in:
parent
96fde908ba
commit
3ff91018cc
3 changed files with 40 additions and 2 deletions
|
|
@ -70,6 +70,20 @@ class DBQueryParserTest extends \Codeception\TestCase\Test
|
|||
$this->assertEquals([20, '20201021'], $params);
|
||||
}
|
||||
|
||||
public function testSelectWithSearch()
|
||||
{
|
||||
$query = Rhymix\Framework\Parsers\DBQueryParser::loadXML(\RX_BASEDIR . 'tests/_data/dbquery/selectTest3.xml');
|
||||
$args = array('division' => 1234, 'last_division' => 4567, 's_title' => '"I love you" -"I hate you"', 's_content' => '"I love you" -"I hate you"', 'page' => 3);
|
||||
$sql = $query->getQueryString('rx_', $args);
|
||||
$params = $query->getQueryParams();
|
||||
|
||||
$this->assertEquals('SELECT DISTINCT * FROM `rx_documents` AS `documents` ' .
|
||||
'WHERE (`list_order` >= ? AND `list_order` < ?) AND ' .
|
||||
'((`title` LIKE ? AND `title` NOT LIKE ?) OR (`content` LIKE ? AND `content` NOT LIKE ?)) AND ' .
|
||||
'ORDER BY `list_order` ASC LIMIT 40, 20', $sql);
|
||||
$this->assertEquals(['1234', '4567', 'I love you', 'I hate you', 'I love you', 'I hate you'], $params);
|
||||
}
|
||||
|
||||
public function testJoin1()
|
||||
{
|
||||
$query = Rhymix\Framework\Parsers\DBQueryParser::loadXML(\RX_BASEDIR . 'tests/_data/dbquery/selectJoinTest1.xml');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue