Eccube\Tests\Repository\CategoryRepositoryTest::testSaveWithParent PHP Method

testSaveWithParent() public method

public testSaveWithParent ( )
    public function testSaveWithParent()
    {
        $faker = $this->getFaker();
        $name = $faker->name;
        $Category = $this->app['eccube.repository.category']->findOneBy(array('name' => '子2-1'));
        $Category->setName($name);
        $updateDate = $Category->getUpdateDate();
        sleep(1);
        $result = $this->app['eccube.repository.category']->save($Category);
        $this->assertTrue($result);
        $this->expected = $updateDate;
        $this->actual = $Category->getUpdateDate();
        $this->assertNotEquals($this->expected, $this->actual);
        // 名前を変更したので null になっているはず
        $Category = $this->app['eccube.repository.category']->findOneBy(array('name' => '子2-1'));
        $this->assertNull($Category);
    }