*/ class ReferenceProxyTest extends \Doctrine\Tests\OrmFunctionalTestCase { private $product; protected function setUp() { $this->useModelSet('ecommerce'); parent::setUp(); $this->_factory = new ProxyFactory($this->_em, new ProxyClassGenerator($this->_em)); } public function testLazyLoadsFieldValuesFromDatabase() { $product = new ECommerceProduct(); $product->setName('Doctrine Cookbook'); $this->_em->persist($product); $this->_em->flush(); $this->_em->clear(); $id = $product->getId(); $productProxy = $this->_factory->getReferenceProxy('Doctrine\Tests\Models\ECommerce\ECommerceProduct', array('id' => $id)); $this->assertEquals('Doctrine Cookbook', $productProxy->getName()); } }