setName() public method

Set name
public setName ( string $name ) : Category
$name string
return Category
 public function testCategoryWithOut()
 {
     $Category = new Category();
     $Category->setName('test')->setRank(1)->setLevel(1)->setDelFlg(Constant::DISABLED)->setCreateDate(new \DateTime())->setUpdateDate(new \DateTime());
     $this->app['orm.em']->persist($Category);
     $this->app['orm.em']->flush();
     $this->searchData = array('category_id' => $Category);
     $this->scenario();
     $this->expected = 0;
     $this->actual = count($this->Results);
     $this->verify();
 }
Ejemplo n.º 2
0
 private function newTestCategory($TestCreator, $TestParentCategory = null)
 {
     $TestCategory = new \Eccube\Entity\Category();
     if ($TestParentCategory == null) {
         $TestCategory->setName('テスト家具')->setRank(100)->setLevel(100)->setDelFlg(false)->setParent($TestParentCategory)->setCreator($TestCreator);
     } else {
         $TestCategory->setName($TestParentCategory->getName() . '_c')->setRank($TestParentCategory->getRank() + 1)->setLevel($TestParentCategory->getLevel() + 1)->setDelFlg(false)->setParent($TestParentCategory)->setCreator($TestCreator);
     }
     return $TestCategory;
 }
Ejemplo n.º 3
0
 public function testSaveWithException()
 {
     $faker = $this->getFaker();
     $name = $faker->name;
     $Category = new Category();
     $Category->setName($name)->setLevel(null);
     // level は not null なので例外になる
     $result = $this->app['eccube.repository.category']->save($Category);
     $this->assertFalse($result);
 }