mirror of
https://github.com/espocrm/espocrm.git
synced 2026-07-01 08:26:04 +00:00
orm: DATE functions
This commit is contained in:
@@ -392,6 +392,18 @@ class QueryTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($expectedSql, $sql);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function testFunction1()
|
||||
{
|
||||
$sql = $this->query->createSelectQuery('Comment', array(
|
||||
'select' => ['id'],
|
||||
'whereClause' => array(
|
||||
'MONTH_NUMBER:comment.created_at' => 2
|
||||
)
|
||||
));
|
||||
$expectedSql =
|
||||
"SELECT comment.id AS `id` FROM `comment` " .
|
||||
"WHERE MONTH(comment.created_at) = '2' AND comment.deleted = '0'";
|
||||
$this->assertEquals($expectedSql, $sql);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user