Index: trunk/extensions/Maps/test/MapsTestSuite.php |
— | — | @@ -0,0 +1,33 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +require_once 'PHPUnit\Framework\TestSuite.php'; |
| 5 | + |
| 6 | +/** |
| 7 | + * Static test suite. |
| 8 | + * |
| 9 | + * @ingroup Maps |
| 10 | + * @since 0.6.5 |
| 11 | + * @author Jeroen De Dauw |
| 12 | + */ |
| 13 | +class MapsTestSuite extends PHPUnit_Framework_TestSuite { |
| 14 | + |
| 15 | + /** |
| 16 | + * Constructs the test suite handler. |
| 17 | + */ |
| 18 | + public function __construct() { |
| 19 | + $this->setName ( 'MapsTestSuite' ); |
| 20 | + |
| 21 | + $this->addTestSuite ( 'MapsCoordinateParserTest' ); |
| 22 | + |
| 23 | + $this->addTestSuite ( 'MapsDistanceParserTest' ); |
| 24 | + |
| 25 | + } |
| 26 | + |
| 27 | + /** |
| 28 | + * Creates the suite. |
| 29 | + */ |
| 30 | + public static function suite() { |
| 31 | + return new self ( ); |
| 32 | + } |
| 33 | +} |
| 34 | + |
Property changes on: trunk/extensions/Maps/test/MapsTestSuite.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 35 | + native |
Index: trunk/extensions/Maps/test/MapsCoordinateParserTest.php |
— | — | @@ -0,0 +1,172 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +require_once 'PHPUnit\Framework\TestCase.php'; |
| 5 | + |
| 6 | +/** |
| 7 | + * MapsCoordinateParser test case. |
| 8 | + * |
| 9 | + * @ingroup Maps |
| 10 | + * @since 0.6.5 |
| 11 | + * @author Jeroen De Dauw |
| 12 | + */ |
| 13 | +class MapsCoordinateParserTest extends PHPUnit_Framework_TestCase { |
| 14 | + |
| 15 | + /** |
| 16 | + * @var MapsCoordinateParser |
| 17 | + */ |
| 18 | + private $MapsCoordinateParser; |
| 19 | + |
| 20 | + /** |
| 21 | + * Prepares the environment before running a test. |
| 22 | + */ |
| 23 | + protected function setUp() { |
| 24 | + parent::setUp (); |
| 25 | + |
| 26 | + // TODO Auto-generated MapsCoordinateParserTest::setUp() |
| 27 | + |
| 28 | + |
| 29 | + $this->MapsCoordinateParser = new MapsCoordinateParser(/* parameters */); |
| 30 | + |
| 31 | + } |
| 32 | + |
| 33 | + /** |
| 34 | + * Cleans up the environment after running a test. |
| 35 | + */ |
| 36 | + protected function tearDown() { |
| 37 | + // TODO Auto-generated MapsCoordinateParserTest::tearDown() |
| 38 | + |
| 39 | + |
| 40 | + $this->MapsCoordinateParser = null; |
| 41 | + |
| 42 | + parent::tearDown (); |
| 43 | + } |
| 44 | + |
| 45 | + /** |
| 46 | + * Constructs the test case. |
| 47 | + */ |
| 48 | + public function __construct() { |
| 49 | + // TODO Auto-generated constructor |
| 50 | + } |
| 51 | + |
| 52 | + /** |
| 53 | + * Tests MapsCoordinateParser::parseCoordinates() |
| 54 | + */ |
| 55 | + public function testParseCoordinates() { |
| 56 | + // TODO Auto-generated MapsCoordinateParserTest::testParseCoordinates() |
| 57 | + $this->markTestIncomplete ( "parseCoordinates test not implemented" ); |
| 58 | + |
| 59 | + MapsCoordinateParser::parseCoordinates(/* parameters */); |
| 60 | + |
| 61 | + } |
| 62 | + |
| 63 | + /** |
| 64 | + * Tests MapsCoordinateParser::getCoordinatesType() |
| 65 | + */ |
| 66 | + public function testGetCoordinatesType() { |
| 67 | + // Floats |
| 68 | + $this->assertEquals( MapsCoordinateParser::getCoordinatesType( '55.7557860 N, 37.6176330 W' ), Maps_COORDS_FLOAT ); |
| 69 | + $this->assertEquals( MapsCoordinateParser::getCoordinatesType( '55.7557860, -37.6176330' ), Maps_COORDS_FLOAT ); |
| 70 | + $this->assertEquals( MapsCoordinateParser::getCoordinatesType( '55 S, 37.6176330 W' ), Maps_COORDS_FLOAT ); |
| 71 | + $this->assertEquals( MapsCoordinateParser::getCoordinatesType( '-55, -37.6176330' ), Maps_COORDS_FLOAT ); |
| 72 | + $this->assertEquals( MapsCoordinateParser::getCoordinatesType( '5.5S,37W ' ), Maps_COORDS_FLOAT ); |
| 73 | + $this->assertEquals( MapsCoordinateParser::getCoordinatesType( '-5.5,-37 ' ), Maps_COORDS_FLOAT ); |
| 74 | + |
| 75 | + // Decimal Degrees |
| 76 | + $this->assertEquals( MapsCoordinateParser::getCoordinatesType( '55.7557860� N, 37.6176330� W' ), Maps_COORDS_DD ); |
| 77 | + $this->assertEquals( MapsCoordinateParser::getCoordinatesType( '55.7557860�, -37.6176330�' ), Maps_COORDS_DD ); |
| 78 | + $this->assertEquals( MapsCoordinateParser::getCoordinatesType( '55� S, 37.6176330 � W' ), Maps_COORDS_DD ); |
| 79 | + $this->assertEquals( MapsCoordinateParser::getCoordinatesType( '-55�, -37.6176330 �' ), Maps_COORDS_DD ); |
| 80 | + $this->assertEquals( MapsCoordinateParser::getCoordinatesType( '5.5�S,37�W ' ), Maps_COORDS_DD ); |
| 81 | + $this->assertEquals( MapsCoordinateParser::getCoordinatesType( '-5.5�,-37� ' ), Maps_COORDS_DD ); |
| 82 | + } |
| 83 | + |
| 84 | + /** |
| 85 | + * Tests MapsCoordinateParser::areCoordinates() |
| 86 | + */ |
| 87 | + public function testAreCoordinates() { |
| 88 | + // TODO Auto-generated MapsCoordinateParserTest::testAreCoordinates() |
| 89 | + $this->markTestIncomplete ( "areCoordinates test not implemented" ); |
| 90 | + |
| 91 | + MapsCoordinateParser::areCoordinates(/* parameters */); |
| 92 | + |
| 93 | + } |
| 94 | + |
| 95 | + /** |
| 96 | + * Tests MapsCoordinateParser::formatCoordinates() |
| 97 | + */ |
| 98 | + public function testFormatCoordinates() { |
| 99 | + // TODO Auto-generated MapsCoordinateParserTest::testFormatCoordinates() |
| 100 | + $this->markTestIncomplete ( "formatCoordinates test not implemented" ); |
| 101 | + |
| 102 | + MapsCoordinateParser::formatCoordinates(/* parameters */); |
| 103 | + |
| 104 | + } |
| 105 | + |
| 106 | + /** |
| 107 | + * Tests MapsCoordinateParser::formatToArray() |
| 108 | + */ |
| 109 | + public function testFormatToArray() { |
| 110 | + // TODO Auto-generated MapsCoordinateParserTest::testFormatToArray() |
| 111 | + $this->markTestIncomplete ( "formatToArray test not implemented" ); |
| 112 | + |
| 113 | + MapsCoordinateParser::formatToArray(/* parameters */); |
| 114 | + |
| 115 | + } |
| 116 | + |
| 117 | + /** |
| 118 | + * Tests MapsCoordinateParser::areFloatCoordinates() |
| 119 | + */ |
| 120 | + public function testAreFloatCoordinates() { |
| 121 | + // TODO Auto-generated MapsCoordinateParserTest::testAreFloatCoordinates() |
| 122 | + $this->markTestIncomplete ( "areFloatCoordinates test not implemented" ); |
| 123 | + |
| 124 | + MapsCoordinateParser::areFloatCoordinates(/* parameters */); |
| 125 | + |
| 126 | + } |
| 127 | + |
| 128 | + /** |
| 129 | + * Tests MapsCoordinateParser::areDMSCoordinates() |
| 130 | + */ |
| 131 | + public function testAreDMSCoordinates() { |
| 132 | + // TODO Auto-generated MapsCoordinateParserTest::testAreDMSCoordinates() |
| 133 | + $this->markTestIncomplete ( "areDMSCoordinates test not implemented" ); |
| 134 | + |
| 135 | + MapsCoordinateParser::areDMSCoordinates(/* parameters */); |
| 136 | + |
| 137 | + } |
| 138 | + |
| 139 | + /** |
| 140 | + * Tests MapsCoordinateParser::areDDCoordinates() |
| 141 | + */ |
| 142 | + public function testAreDDCoordinates() { |
| 143 | + // TODO Auto-generated MapsCoordinateParserTest::testAreDDCoordinates() |
| 144 | + $this->markTestIncomplete ( "areDDCoordinates test not implemented" ); |
| 145 | + |
| 146 | + MapsCoordinateParser::areDDCoordinates(/* parameters */); |
| 147 | + |
| 148 | + } |
| 149 | + |
| 150 | + /** |
| 151 | + * Tests MapsCoordinateParser::areDMCoordinates() |
| 152 | + */ |
| 153 | + public function testAreDMCoordinates() { |
| 154 | + // TODO Auto-generated MapsCoordinateParserTest::testAreDMCoordinates() |
| 155 | + $this->markTestIncomplete ( "areDMCoordinates test not implemented" ); |
| 156 | + |
| 157 | + MapsCoordinateParser::areDMCoordinates(/* parameters */); |
| 158 | + |
| 159 | + } |
| 160 | + |
| 161 | + /** |
| 162 | + * Tests MapsCoordinateParser::parseAndFormat() |
| 163 | + */ |
| 164 | + public function testParseAndFormat() { |
| 165 | + // TODO Auto-generated MapsCoordinateParserTest::testParseAndFormat() |
| 166 | + $this->markTestIncomplete ( "parseAndFormat test not implemented" ); |
| 167 | + |
| 168 | + MapsCoordinateParser::parseAndFormat(/* parameters */); |
| 169 | + |
| 170 | + } |
| 171 | + |
| 172 | +} |
| 173 | + |
Property changes on: trunk/extensions/Maps/test/MapsCoordinateParserTest.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 174 | + native |
Index: trunk/extensions/Maps/test/MapsDistanceParserTest.php |
— | — | @@ -0,0 +1,129 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +require_once 'PHPUnit\Framework\TestCase.php'; |
| 5 | + |
| 6 | +/** |
| 7 | + * MapsDistanceParser test case. |
| 8 | + * |
| 9 | + * @ingroup Maps |
| 10 | + * @since 0.6.5 |
| 11 | + * @author Jeroen De Dauw |
| 12 | + */ |
| 13 | +class MapsDistanceParserTest extends PHPUnit_Framework_TestCase { |
| 14 | + |
| 15 | + /** |
| 16 | + * @var MapsDistanceParser |
| 17 | + */ |
| 18 | + private $MapsDistanceParser; |
| 19 | + |
| 20 | + /** |
| 21 | + * Prepares the environment before running a test. |
| 22 | + */ |
| 23 | + protected function setUp() { |
| 24 | + parent::setUp (); |
| 25 | + |
| 26 | + // TODO Auto-generated MapsDistanceParserTest::setUp() |
| 27 | + |
| 28 | + |
| 29 | + $this->MapsDistanceParser = new MapsDistanceParser(/* parameters */); |
| 30 | + |
| 31 | + } |
| 32 | + |
| 33 | + /** |
| 34 | + * Cleans up the environment after running a test. |
| 35 | + */ |
| 36 | + protected function tearDown() { |
| 37 | + // TODO Auto-generated MapsDistanceParserTest::tearDown() |
| 38 | + |
| 39 | + |
| 40 | + $this->MapsDistanceParser = null; |
| 41 | + |
| 42 | + parent::tearDown (); |
| 43 | + } |
| 44 | + |
| 45 | + /** |
| 46 | + * Constructs the test case. |
| 47 | + */ |
| 48 | + public function __construct() { |
| 49 | + // TODO Auto-generated constructor |
| 50 | + } |
| 51 | + |
| 52 | + /** |
| 53 | + * Tests MapsDistanceParser::parseDistance() |
| 54 | + */ |
| 55 | + public function testParseDistance() { |
| 56 | + // TODO Auto-generated MapsDistanceParserTest::testParseDistance() |
| 57 | + $this->markTestIncomplete ( "parseDistance test not implemented" ); |
| 58 | + |
| 59 | + MapsDistanceParser::parseDistance(/* parameters */); |
| 60 | + |
| 61 | + } |
| 62 | + |
| 63 | + /** |
| 64 | + * Tests MapsDistanceParser::formatDistance() |
| 65 | + */ |
| 66 | + public function testFormatDistance() { |
| 67 | + // TODO Auto-generated MapsDistanceParserTest::testFormatDistance() |
| 68 | + $this->markTestIncomplete ( "formatDistance test not implemented" ); |
| 69 | + |
| 70 | + MapsDistanceParser::formatDistance(/* parameters */); |
| 71 | + |
| 72 | + } |
| 73 | + |
| 74 | + /** |
| 75 | + * Tests MapsDistanceParser::parseAndFormat() |
| 76 | + */ |
| 77 | + public function testParseAndFormat() { |
| 78 | + // TODO Auto-generated MapsDistanceParserTest::testParseAndFormat() |
| 79 | + $this->markTestIncomplete ( "parseAndFormat test not implemented" ); |
| 80 | + |
| 81 | + MapsDistanceParser::parseAndFormat(/* parameters */); |
| 82 | + |
| 83 | + } |
| 84 | + |
| 85 | + /** |
| 86 | + * Tests MapsDistanceParser::isDistance() |
| 87 | + */ |
| 88 | + public function testIsDistance() { |
| 89 | + // TODO Auto-generated MapsDistanceParserTest::testIsDistance() |
| 90 | + $this->markTestIncomplete ( "isDistance test not implemented" ); |
| 91 | + |
| 92 | + MapsDistanceParser::isDistance(/* parameters */); |
| 93 | + |
| 94 | + } |
| 95 | + |
| 96 | + /** |
| 97 | + * Tests MapsDistanceParser::getUnitRatio() |
| 98 | + */ |
| 99 | + public function testGetUnitRatio() { |
| 100 | + // TODO Auto-generated MapsDistanceParserTest::testGetUnitRatio() |
| 101 | + $this->markTestIncomplete ( "getUnitRatio test not implemented" ); |
| 102 | + |
| 103 | + MapsDistanceParser::getUnitRatio(/* parameters */); |
| 104 | + |
| 105 | + } |
| 106 | + |
| 107 | + /** |
| 108 | + * Tests MapsDistanceParser::getValidUnit() |
| 109 | + */ |
| 110 | + public function testGetValidUnit() { |
| 111 | + // TODO Auto-generated MapsDistanceParserTest::testGetValidUnit() |
| 112 | + $this->markTestIncomplete ( "getValidUnit test not implemented" ); |
| 113 | + |
| 114 | + MapsDistanceParser::getValidUnit(/* parameters */); |
| 115 | + |
| 116 | + } |
| 117 | + |
| 118 | + /** |
| 119 | + * Tests MapsDistanceParser::getUnits() |
| 120 | + */ |
| 121 | + public function testGetUnits() { |
| 122 | + // TODO Auto-generated MapsDistanceParserTest::testGetUnits() |
| 123 | + $this->markTestIncomplete ( "getUnits test not implemented" ); |
| 124 | + |
| 125 | + MapsDistanceParser::getUnits(/* parameters */); |
| 126 | + |
| 127 | + } |
| 128 | + |
| 129 | +} |
| 130 | + |
Property changes on: trunk/extensions/Maps/test/MapsDistanceParserTest.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 131 | + native |
Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | echo '<b>Warning:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.'; |
35 | 35 | } |
36 | 36 | else { |
37 | | - define( 'Maps_VERSION', '0.6.5 a4' ); |
| 37 | + define( 'Maps_VERSION', '0.6.5 a5' ); |
38 | 38 | |
39 | 39 | // The different coordinate notations. |
40 | 40 | define( 'Maps_COORDS_FLOAT', 'float' ); |
Index: trunk/extensions/Maps/RELEASE-NOTES |
— | — | @@ -16,10 +16,12 @@ |
17 | 17 | |
18 | 18 | * Moved map id creation to the mapping service class for all features. |
19 | 19 | |
20 | | -* Moved marker js creation for display_points to the mapping service class for all features. |
| 20 | +* Moved marker JavaScript creation for display_points to the mapping service class for all features. |
21 | 21 | |
22 | 22 | * Moved default zoom level access method to the mapping service class for all features. |
23 | 23 | |
| 24 | +* Improved the way marker data is turned into JavaScript variables. |
| 25 | + |
24 | 26 | === Maps 0.6.4 === |
25 | 27 | (2010-07-08) |
26 | 28 | |