From 902d609fcaeb07b61a12121f1a64917075f4db28 Mon Sep 17 00:00:00 2001 From: jackbravo Date: Mon, 3 Sep 2007 18:54:58 +0000 Subject: [PATCH] Removed one unnecesary class, more to go --- models/ExpressionTest.php | 9 --------- tests/ExpressionTestCase.php | 26 ++++++++------------------ 2 files changed, 8 insertions(+), 27 deletions(-) delete mode 100644 models/ExpressionTest.php diff --git a/models/ExpressionTest.php b/models/ExpressionTest.php deleted file mode 100644 index cab1d2ad2..000000000 --- a/models/ExpressionTest.php +++ /dev/null @@ -1,9 +0,0 @@ -hasColumn('name', 'string'); - $this->hasColumn('amount', 'integer'); - } -} diff --git a/tests/ExpressionTestCase.php b/tests/ExpressionTestCase.php index 6abb957c5..8842e34c3 100644 --- a/tests/ExpressionTestCase.php +++ b/tests/ExpressionTestCase.php @@ -32,41 +32,31 @@ */ class Doctrine_Expression_TestCase extends Doctrine_UnitTestCase { - public function prepareTables() - { - $this->tables = array('ExpressionTest'); - - parent::prepareTables(); - } public function prepareData() { - } + public function testSavingWithAnExpression() { + $e = new Doctrine_Expression("CONCAT('some', 'one')"); + $this->assertEqual($e->getSql(), "CONCAT('some', 'one')"); - $e = new ExpressionTest(); - - $e->name = new Doctrine_Expression("CONCAT('some', 'one')"); - - $e->save(); - - $e->refresh(); - - $this->assertEqual($e->name, 'someone'); + $u = new User(); + $u->name = $e; + $u->save(); + $u->refresh(); + $this->assertEqual($u->name, 'someone'); } public function testExpressionParserSupportsNumericalClauses() { $e = new Doctrine_Expression('1 + 2'); - $this->assertEqual($e->getSql(), '1 + 2'); } public function testExpressionParserSupportsFunctionComposition() { $e = new Doctrine_Expression("SUBSTRING(CONCAT('some', 'one'), 0, 3)"); - $this->assertEqual($e->getSql(), "SUBSTR(CONCAT('some', 'one'), 0, 3)"); } }