setShipping() публичный Метод

public setShipping ( ECommerceShipping $shipping )
$shipping ECommerceShipping
 protected function _createFixture()
 {
     $product = new ECommerceProduct();
     $product->setName('Php manual');
     $shipping = new ECommerceShipping();
     $shipping->setDays('1');
     $product->setShipping($shipping);
     $this->_em->persist($product);
     $this->_em->flush();
     $this->_em->clear();
 }
Пример #2
0
 public function testDoNotInitializeProxyOnGettingTheIdentifierAndReturnTheRightType()
 {
     $product = new ECommerceProduct();
     $product->setName('Doctrine Cookbook');
     $shipping = new ECommerceShipping();
     $shipping->setDays(1);
     $product->setShipping($shipping);
     $this->_em->persist($product);
     $this->_em->flush();
     $this->_em->clear();
     $id = $shipping->getId();
     $product = $this->_em->getRepository('Doctrine\\Tests\\Models\\ECommerce\\ECommerceProduct')->find($product->getId());
     $entity = $product->getShipping();
     $this->assertFalse($entity->__isInitialized__, "Pre-Condition: Object is unitialized proxy.");
     $this->assertEquals($id, $entity->getId());
     $this->assertSame($id, $entity->getId(), "Check that the id's are the same value, and type.");
     $this->assertFalse($entity->__isInitialized__, "Getting the identifier doesn't initialize the proxy.");
 }