diff --git a/Doctrine/Record.php b/Doctrine/Record.php index e073eb984..7dd711ff1 100644 --- a/Doctrine/Record.php +++ b/Doctrine/Record.php @@ -805,7 +805,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite case 'object': $a[$v] = serialize($this->data[$v]); break;; - case 'enum' + case 'enum': $a[$v] = $this->table->enumIndex($v,$this->data[$v]); break; default: diff --git a/tests/ValidatorTestCase.php b/tests/ValidatorTestCase.php index d2a7b3976..ddadcec46 100644 --- a/tests/ValidatorTestCase.php +++ b/tests/ValidatorTestCase.php @@ -1,7 +1,7 @@ tables[] = "Validator_Test"; + $this->tables[] = "ValidatorTest"; parent::prepareTables(); } public function testIsValidType() { @@ -70,7 +70,7 @@ class Doctrine_ValidatorTestCase extends Doctrine_UnitTestCase { } public function testValidate2() { - $test = new Validator_Test(); + $test = new ValidatorTest(); $test->mymixed = "message"; $validator = new Doctrine_Validator(); @@ -79,8 +79,9 @@ class Doctrine_ValidatorTestCase extends Doctrine_UnitTestCase { $stack = $validator->getErrorStack(); $this->assertTrue(is_array($stack)); + $this->assertTrue(isset($stack['ValidatorTest'][0])); + $stack = $stack['ValidatorTest'][0]; - $stack = $stack['Validator_Test'][0]; $this->assertEqual($stack['mystring'], Doctrine_Validator::ERR_NOTNULL); $this->assertEqual($stack['myemail2'], Doctrine_Validator::ERR_NOTBLANK); @@ -136,7 +137,7 @@ class Doctrine_ValidatorTestCase extends Doctrine_UnitTestCase { $this->assertFalse($validator->validate($email,"address","example@e..",null)); $this->assertFalse($validator->validate($email,"address","example@e..",null)); - + } public function testSave() { diff --git a/tests/classes.php b/tests/classes.php index f2734688c..1f6cefca4 100644 --- a/tests/classes.php +++ b/tests/classes.php @@ -390,7 +390,7 @@ class Log_Status extends Doctrine_Record { $this->hasColumn("name", "string", 255); } } -class Validator_Test extends Doctrine_Record { +class ValidatorTest extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn("mymixed","string", 100); $this->hasColumn("mystring","string", 100, "notnull|unique");