/** * @covers Kunstmaan\NodeBundle\Helper\Menu\ActionsMenuBuilder::createActionsMenu */ public function testShouldShowDeleteButtonWhenTheNodeHasAParent() { $nodeTranslation = new NodeTranslation(); $node = new Node(); $node->setParent(new Node()); $nodeTranslation->setNode($node); $nodeVersion = new NodeVersion(); $nodeVersion->setType('public'); $nodeVersion->setNodeTranslation($nodeTranslation); $this->builder->setActiveNodeVersion($nodeVersion); $menu = $this->builder->createActionsMenu(); $this->assertNotNull($menu->getChild('action.delete')); $this->assertEquals('page-main-actions js-auto-collapse-buttons', $menu->getChildrenAttribute('class')); }
/** * @covers Kunstmaan\NodeBundle\Helper\Menu\ActionsMenuBuilder::createActionsMenu */ public function testShouldShowRecopyButtonWhenTheNodeHasTranslations() { $node = new Node(); $nodeTranslation = new NodeTranslation(); $nodeTranslation->setLang('en'); $node->addNodeTranslation($nodeTranslation); $nodeVersion = new NodeVersion(); $nodeVersion->setType("public"); $nodeVersion->setNodeTranslation($nodeTranslation); $this->builder->setActiveNodeVersion($nodeVersion); $nodeTranslation = new NodeTranslation(); $nodeTranslation->setLang('nl'); $node->addNodeTranslation($nodeTranslation); $nodeVersion = new NodeVersion(); $nodeVersion->setType("public"); $nodeVersion->setNodeTranslation($nodeTranslation); $this->builder->setActiveNodeVersion($nodeVersion); $menu = $this->builder->createActionsMenu(); $this->assertNotNull($menu->getChild('action.recopyfromlanguage')); $this->assertEquals('page-main-actions js-auto-collapse-buttons', $menu->getChildrenAttribute('class')); }