/** * testCreateActionsMenuNonEditable */ public function testCreateActionsMenuNonEditable() { $nodeTranslation = new NodeTranslation(); $nodeTranslation->setNode(new Node()); $nodeVersion = new NodeVersion(); $nodeVersion->setType("public"); $nodeVersion->setNodeTranslation($nodeTranslation); $this->builder->setEditableNode(false); $this->builder->setActiveNodeVersion($nodeVersion); $nodeTranslation->setOnline(false); $menu = $this->builder->createActionsMenu(); $this->assertNotNull($menu->getChild('action.save')); // We want to save. $this->assertNull($menu->getChild('action.saveasdraft')); $this->assertNull($menu->getChild('action.preview')); $this->assertNull($menu->getChild('action.publish')); $this->assertNull($menu->getChild('action.unpublish')); $this->assertEquals('page-main-actions js-auto-collapse-buttons', $menu->getChildrenAttribute('class')); }