/** * Test default value of attributes when creating an object. * * @return void */ public function testAttribsNotSet() { $node = new Services_OpenStreetMap_Node(); $this->assertEquals($node->getVersion(), null); $this->assertEquals($node->getUser(), null); $this->assertEquals($node->getUid(), null); $this->assertEquals($node->getId(), null); $this->assertEquals('' . $node, ''); }
/** * Add a node to the way. * * @param Services_OpenStreetMap_Node $node Node to add to the way. * * @return Services_OpenStreetMap_Way */ public function addNode(Services_OpenStreetMap_Node $node) { $id = $node->getId(); $pos = array_search($id, $this->nodes); if ($pos === false) { $this->action = 'modify'; $this->nodes[] = $id; $this->dirty = true; $this->dirtyNodes = true; $this->nodesNew[] = $id; } return $this; }