* * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /** * Syntax tests for the openlayersmap plugin. * * @group plugin_openlayersmap * @group plugins */ class syntax_plugin_openlayersmap_test extends DokuWikiTest { protected $pluginsEnabled = array('openlayersmap', 'geophp'); /** * copy data and add pages to the index. */ public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); global $conf; $conf['allowdebug'] = 1; $conf['dontlog'] = ''; $conf['cachetime'] = -1; $conf['plugin']['openlayersmap']['displayformat'] = 'DD'; $conf['plugin']['openlayersmap']['optionStaticMapGenerator'] = 'local'; $conf['plugin']['openlayersmap']['autoZoomMap'] = 1; TestUtils::rcopy(TMP_DIR, __DIR__ . '/data/'); } final public function setUp(): void { parent::setUp(); global $conf; // $data = array(); // search($data, $conf['datadir'], 'search_allpages', array('skipacl' => true)); // foreach($data as $val) { // idx_addPage($val['id']); // } if($conf['allowdebug']) { if(mkdir(DOKU_TMP_DATA . 'data/log/debug/', 0777, true)) { touch(DOKU_TMP_DATA . 'data/log/debug/' . date('Y-m-d') . '.log'); } } } final public function tearDown(): void { parent::tearDown(); global $conf; // try to get the debug log after running the test, print and clear if($conf['allowdebug']) { print "\n"; readfile(DOKU_TMP_DATA . 'data/log/debug/' . date('Y-m-d') . '.log'); unlink(DOKU_TMP_DATA . 'data/log/debug/' . date('Y-m-d') . '.log'); } } final public function test_rur(): void { $request = new TestRequest(); $response = $request->get(array('id' => 'rur')); self::assertNotNull($response); $_content = $response->getContent(); self::assertStringContainsString('Rur', $_content); self::assertStringContainsString('', $_content); self::assertStringContainsString('
| id | \n //symbol | \n //latitude | \n //longitude | \n //description | \n //
|---|---|---|---|---|
| Rur parkings | ||||
| 1 | \n //50.548611º | \n //6.228889º | \n //Parking Dreistegen | \n
// |
| 2 | \n //50.56384º | \n //6.29766º | \n //Parking Grünenthalstrasse | \n
// |