Commit 902d609f authored by jackbravo's avatar jackbravo

Removed one unnecesary class, more to go

parent 94cb373b
<?php
class ExpressionTest extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('name', 'string');
$this->hasColumn('amount', 'integer');
}
}
...@@ -32,41 +32,31 @@ ...@@ -32,41 +32,31 @@
*/ */
class Doctrine_Expression_TestCase extends Doctrine_UnitTestCase class Doctrine_Expression_TestCase extends Doctrine_UnitTestCase
{ {
public function prepareTables()
{
$this->tables = array('ExpressionTest');
parent::prepareTables();
}
public function prepareData() public function prepareData()
{ {
} }
public function testSavingWithAnExpression() public function testSavingWithAnExpression()
{ {
$e = new Doctrine_Expression("CONCAT('some', 'one')");
$e = new ExpressionTest(); $this->assertEqual($e->getSql(), "CONCAT('some', 'one')");
$e->name = new Doctrine_Expression("CONCAT('some', 'one')"); $u = new User();
$u->name = $e;
$e->save(); $u->save();
$u->refresh();
$e->refresh(); $this->assertEqual($u->name, 'someone');
$this->assertEqual($e->name, 'someone');
} }
public function testExpressionParserSupportsNumericalClauses() public function testExpressionParserSupportsNumericalClauses()
{ {
$e = new Doctrine_Expression('1 + 2'); $e = new Doctrine_Expression('1 + 2');
$this->assertEqual($e->getSql(), '1 + 2'); $this->assertEqual($e->getSql(), '1 + 2');
} }
public function testExpressionParserSupportsFunctionComposition() public function testExpressionParserSupportsFunctionComposition()
{ {
$e = new Doctrine_Expression("SUBSTRING(CONCAT('some', 'one'), 0, 3)"); $e = new Doctrine_Expression("SUBSTRING(CONCAT('some', 'one'), 0, 3)");
$this->assertEqual($e->getSql(), "SUBSTR(CONCAT('some', 'one'), 0, 3)"); $this->assertEqual($e->getSql(), "SUBSTR(CONCAT('some', 'one'), 0, 3)");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment