1<?php
2
3/**
4 * Doctrine_Ticket_587_TestCase
5 *
6 * @package     Doctrine
7 * @author      Joaquin Bravo <jackbravo@gmail.com>
8 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
9 * @category    Object Relational Mapping
10 * @link        www.doctrine-project.org
11 * @since       1.0
12 * @version     $Revision$
13 */
14
15class Doctrine_Ticket_583_TestCase extends Doctrine_UnitTestCase
16{
17    public function prepareTables()
18    {
19        $this->tables = array('Entity');
20        parent::prepareTables();
21    }
22
23    public function prepareData() { }
24
25    public function testBug()
26    {
27        $entity = new Entity();
28        $entity->name = 'myname';
29        $entity->save();
30
31        // load our user and our collection of pages
32        $user = Doctrine_Query::create()->select('id')->from('Entity')->fetchOne();
33        $this->assertEqual($user->name, 'myname');
34
35        // load our user and our collection of pages
36        $user = Doctrine_Query::create()->select('*')->from('Entity')->fetchOne();
37        $this->assertEqual($user->name, 'myname');
38    }
39}
40