. */ /** * Doctrine_Query_Check_TestCase * * @package Doctrine * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ */ class Doctrine_Query_Check_TestCase extends Doctrine_UnitTestCase { public function prepareData() { } public function prepareTables() { } public function testCheckParserSupportsStandardFunctions() { $q = new Doctrine_Query_Check('User'); $q->parse('LENGTH(name) > 6'); $this->assertEqual($q->getSql(), 'LENGTH(name) > 6'); } public function testCheckParserThrowsExceptionForUnknownOperator() { $q = new Doctrine_Query_Check('User'); try { $q->parse('LENGTH(name) ? 6'); $this->fail(); } catch(Doctrine_Query_Exception $e) { $this->pass(); } } public function testCheckParserThrowsExceptionForUnknownFunction() { $q = new Doctrine_Query_Check('User'); try { $q->parse('SomeUnknownFunction(name) = 6'); $this->fail(); } catch(Doctrine_Exception $e) { $this->pass(); } } }