1
0
mirror of synced 2025-02-06 15:29:26 +03:00

Removed one unnecesary class, more to go

This commit is contained in:
jackbravo 2007-09-03 18:54:58 +00:00
parent 94cb373b6d
commit 902d609fca
2 changed files with 8 additions and 27 deletions

View File

@ -1,9 +0,0 @@
<?php
class ExpressionTest extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('name', 'string');
$this->hasColumn('amount', 'integer');
}
}

View File

@ -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')");
$this->assertEqual($e->getSql(), "CONCAT('some', 'one')");
$e = new ExpressionTest(); $u = new User();
$u->name = $e;
$e->name = new Doctrine_Expression("CONCAT('some', 'one')"); $u->save();
$u->refresh();
$e->save(); $this->assertEqual($u->name, 'someone');
$e->refresh();
$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)");
} }
} }