| @@ 3-20 (lines=18) @@ | ||
| 1 | <?php |
|
| 2 | ||
| 3 | class NearestPOIPageTest extends SapphireTest |
|
| 4 | { |
|
| 5 | protected static $fixture_file = 'mappable-poi/tests/pointsofinterest.yml'; |
|
| 6 | ||
| 7 | public function testCMSFields() |
|
| 8 | { |
|
| 9 | $np = new NearestPOIPage(); |
|
| 10 | $fields = $np->getCMSFields(); |
|
| 11 | $tab = $fields->findOrMakeTab('Root.Layer'); |
|
| 12 | $fields = $tab->FieldList(); |
|
| 13 | $names = array(); |
|
| 14 | foreach ($fields as $field) { |
|
| 15 | $names[] = $field->getName(); |
|
| 16 | } |
|
| 17 | $expected = array('PointsOfInterestLayerID'); |
|
| 18 | $this->assertEquals($expected, $names); |
|
| 19 | } |
|
| 20 | } |
|
| 21 | ||
| @@ 3-19 (lines=17) @@ | ||
| 1 | <?php |
|
| 2 | ||
| 3 | class PointsOfInterestLayerTest extends SapphireTest |
|
| 4 | { |
|
| 5 | public function testUpdateCMSFields() |
|
| 6 | { |
|
| 7 | $layer = new PointsOfInterestLayer(); |
|
| 8 | $fields = $layer->getCMSFields(); |
|
| 9 | $root = $fields->fieldByName('Root.Main'); |
|
| 10 | $fields = $root->FieldList(); |
|
| 11 | $names = array(); |
|
| 12 | foreach ($fields as $field) { |
|
| 13 | $names[] = $field->getName(); |
|
| 14 | } |
|
| 15 | ||
| 16 | $expected = array('Name', 'ShowGuideMarkers', 'DefaultIcon'); |
|
| 17 | $this->assertEquals($expected, $names); |
|
| 18 | } |
|
| 19 | } |
|
| 20 | ||
| 21 | class PointsOfInterestLayerTestObjectTO extends DataObject implements TestOnly |
|
| 22 | { |
|