Permalink
Browse files

more work on improving the code coverage

  • Loading branch information...
1 parent acb7839 commit 202f28e133ada0cd5c294b0671f7cadae3e37a88 @kenguest committed Oct 8, 2011
Showing with 18,945 additions and 1 deletion.
  1. +1 −1 Services/Openstreetmap/Object.php
  2. +2 −0 tests/ChangesetTest.php
  3. +19 −0 tests/OSMTest.php
  4. +18,923 −0 tests/files/osm.osm
@@ -70,7 +70,7 @@ public function __toString()
{
$changeXML = $this->getOsmChangeXML();
if (is_null($changeXML)) {
- return $this->getXml();
+ return '' . $this->getXml();
} else {
return $changeXML;
}
View
@@ -215,9 +215,11 @@ public function testSameObjectAddedToChangeset() {
$way = $osm->getWay($wayId);
$way->setTag('highway', 'residential');
$way->setTag('lit', 'yes');
+ $this->assertNotEquals('' . $way, '');
$way2 = $osm->getWay($wayId);
$way2->setTag('highway', 'residential');
$way2->setTag('lit', 'yes');
+ $this->assertNotEquals('' . $way2, '');
$this->assertEquals(false, $changeset->isOpen());
$changeset->begin("Undo accidental highway change from residential to service");
$changeset->add($way);
View
@@ -32,6 +32,15 @@ public function testCreateObject()
$osm = new Services_Openstreetmap();
}
+ public function testLoadXML()
+ {
+ $osm = new Services_Openstreetmap();
+ $this->assertEquals($osm->getXML(), null);
+ $osm->loadXML(__DIR__ . '/files/osm.osm');
+ $this->assertNotEquals($osm->getXML(), null);
+
+ }
+
public function testCapabilities()
{
$mock = new HTTP_Request2_Adapter_Mock();
@@ -447,6 +456,16 @@ public function testUserHomeSet()
$this->assertEquals($user->getLat(), 1.234567);
$this->assertEquals($user->getLon(), -1.234567);
}
+
+ 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, '');
+ }
}
// vim:set et ts=4 sw=4:
?>
Oops, something went wrong.

0 comments on commit 202f28e

Please sign in to comment.