-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optional second parameter (fmt) for Oracle TRUNC function + test. (#301)
Oracle TRUNC function fmt parameter is optional
- Loading branch information
1 parent
1d02c58
commit 469f653
Showing
2 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Query\Oracle; | ||
|
||
use DoctrineExtensions\Tests\Query\OracleTestCase; | ||
|
||
/** | ||
* @author Alexey Kalinin <nitso@yandex.ru> | ||
*/ | ||
class TruncTest extends OracleTestCase | ||
{ | ||
public function testFullQuery() | ||
{ | ||
$dql = 'SELECT TRUNC(d.created, \'YYYY\') FROM DoctrineExtensions\\Tests\\Entities\\Date d'; | ||
$q = $this->entityManager->createQuery($dql); | ||
|
||
$sql = 'SELECT TRUNC(d0_.created, \'YYYY\') AS sclr_0 FROM Date d0_'; | ||
$this->assertEquals($sql, $q->getSql()); | ||
} | ||
|
||
public function testShortQuery() | ||
{ | ||
$dql = 'SELECT TRUNC(d.created) FROM DoctrineExtensions\\Tests\\Entities\\Date d'; | ||
$q = $this->entityManager->createQuery($dql); | ||
|
||
$sql = 'SELECT TRUNC(d0_.created) AS sclr_0 FROM Date d0_'; | ||
$this->assertEquals($sql, $q->getSql()); | ||
} | ||
} |