function testPerformFailedEntityHasChildren() { $entity = new ServiceNode(); $entity->set('oid', $id = 1001); $node =& $entity->getNodePart(); $node->set('id', $node_id = 10); $this->tree->expectOnce('countChildren', array($node_id)); $this->tree->setReturnValue('countChildren', 1); $command = new ServiceNodeDeleteCommand($entity); $this->assertEqual($command->perform(), LIMB_STATUS_ERROR); $uow =& $this->toolkit->getUOW(); $this->assertFalse($uow->isDeleted($entity)); }
function performDeleteEntity() { include_once LIMB_SERVICE_NODE_DIR . '/commands/ServiceNodeDeleteCommand.class.php'; $command = new ServiceNodeDeleteCommand($this->entity); return $command->perform(); }