예제 #1
0
 public function setUp()
 {
     parent::setUp();
     $softDeleteFilter = $this->app['orm.em']->getFilters()->getFilter('soft_delete');
     $softDeleteFilter->setExcludes(array('Eccube\\Entity\\ProductClass'));
     // soft_delete filter を有効にする
     $config = $this->app['orm.em']->getConfiguration();
     $config->addFilter("soft_delete", '\\Eccube\\Doctrine\\Filter\\SoftDeleteFilter');
     $this->app['orm.em']->getFilters()->enable('soft_delete');
     // eccube_install.sh で追加される Member
     $Member = $this->app['eccube.repository.member']->find(2);
     $Product = new Product();
     $ProductClass = new ProductClass();
     $Disp = $this->app['eccube.repository.master.disp']->find(\Eccube\Entity\Master\Disp::DISPLAY_HIDE);
     $ProductType = $this->app['eccube.repository.master.product_type']->find($this->app['config']['product_type_normal']);
     $Product->setName('test')->setCreator($Member)->setDelFlg(Constant::DISABLED)->addProductClass($ProductClass)->setStatus($Disp);
     $ProductClass->setPrice02(1000)->setCreator($Member)->setDelFlg(Constant::DISABLED)->setStockUnlimited(true)->setProductType($ProductType)->setProduct($Product);
     $ProductStock = new \Eccube\Entity\ProductStock();
     $ProductStock->setCreator($Member);
     $ProductClass->setProductStock($ProductStock);
     $ProductStock->setProductClass($ProductClass);
     $this->app['orm.em']->persist($Product);
     $this->app['orm.em']->persist($ProductClass);
     $this->app['orm.em']->persist($ProductStock);
     $this->app['orm.em']->flush();
     $this->Product = $Product;
     $this->ProductClass = $ProductClass;
 }
 public function setUp()
 {
     self::$app['orm.em']->getConnection()->beginTransaction();
     // eccube_install.sh で追加される Member
     $Member = self::$app['eccube.repository.member']->find(2);
     $Product = new Product();
     $ProductClass = new ProductClass();
     $Disp = self::$app['eccube.repository.master.disp']->find(\Eccube\Entity\Master\Disp::DISPLAY_HIDE);
     $ProductType = self::$app['eccube.repository.master.product_type']->find(self::$app['config']['product_type_normal']);
     $Product->setName('test')->setCreator($Member)->setDelFlg(Constant::DISABLED)->addProductClass($ProductClass)->setStatus($Disp);
     $ProductClass->setPrice02(1000)->setCreator($Member)->setDelFlg(Constant::DISABLED)->setStockUnlimited(true)->setProductType($ProductType)->setProduct($Product);
     $ProductStock = new \Eccube\Entity\ProductStock();
     $ProductStock->setCreator($Member);
     $ProductClass->setProductStock($ProductStock);
     $ProductStock->setProductClass($ProductClass);
     self::$app['orm.em']->persist($Product);
     self::$app['orm.em']->persist($ProductClass);
     self::$app['orm.em']->persist($ProductStock);
     self::$app['orm.em']->flush();
     $this->Product = $Product;
     $this->ProductClass = $ProductClass;
 }