Skip to content

Commit

Permalink
Add test for search
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Čihař <[email protected]>
  • Loading branch information
nijel committed Nov 17, 2016
1 parent 31ee176 commit 2dcf953
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/ShapeFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,21 @@ public function shapes()
),
);
}

public function testSearch()
{
$shp = new ShapeFile(0);
$shp->loadFromFile('data/capitals.*');
/* Nonexisting entry or no dbase support */
$this->assertEquals(
-1,
$shp->getIndexFromDBFData('CNTRY_NAME', 'nonexisting')
);
if (ShapeFile::supports_dbase()) {
$this->assertEquals(
218,
$shp->getIndexFromDBFData('CNTRY_NAME', 'Czech Republic')
);
}
}
}

0 comments on commit 2dcf953

Please sign in to comment.