Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Test
- <?php
- require_once dirname(__FILE__) . '/../test_helper.php';
- require_once MODEL_PATH . '/user.php';
- class UserTest extends UnitTestCase {
- function setUp(){
- $q = new Doctrine_RawSql();
- $q->parseQuery('delete from users');
- $q->execute();
- }
- function testShouldCreateUser(){
- $user = new User;
- $user->login = 'bobby';
- $user->password = 'test';
- $id = $user->save();
- $this->assertTrue($id);
- }
- }
- $test = &new UserTest();
- $test->run(new TestReporter());
- ?>
- ## Output
- UserTest
- Exception 1!
- Unexpected exception of type [Doctrine_Connection_Mysql_Exception] with message [SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM users' at line 1] in [/Users/jmartin/Projects/vaga/vendor/doctrine/lib/Doctrine/Connection.php line 867]
- FAILURES!!!
- Test cases run: 1/1, Passes: 0, Failures: 0, Exceptions: 1
Add Comment
Please, Sign In to add comment