/** * @test */ public function constructorSetsPathWorkspaceAndIdentifier() { $node = new NodeData('/foo/bar', $this->mockWorkspace, '12345abcde'); $this->assertSame('/foo/bar', $node->getPath()); $this->assertSame('bar', $node->getName()); $this->assertSame($this->mockWorkspace, $node->getWorkspace()); $this->assertSame('12345abcde', $node->getIdentifier()); }
/** * Returns the name of this node * * @return string * @api */ public function getName() { return $this->nodeData->getName(); }
/** * Returns TRUE if the given node is of the node type this filter expects. * * @param NodeData $node * @return boolean */ public function matches(NodeData $node) { return $node->getName() === $this->nodeName; }
/** * Returns TRUE if the given node does not yet have the new name. * * @param NodeData $node * @return boolean */ public function isTransformable(NodeData $node) { return $node->getName() !== $this->newName; }