@@ -23,86 +23,86 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | class syntax_plugin_geotag_test extends DokuWikiTest { |
| 25 | 25 | |
| 26 | - protected $pluginsEnabled = array('geotag'); |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * copy data and add pages to the index. |
|
| 30 | - */ |
|
| 31 | - public static function setUpBeforeClass() { |
|
| 32 | - parent::setUpBeforeClass(); |
|
| 33 | - global $conf; |
|
| 34 | - $conf['allowdebug'] = 1; |
|
| 35 | - |
|
| 36 | - TestUtils::rcopy(TMP_DIR, dirname(__FILE__).'/data/'); |
|
| 37 | - |
|
| 38 | - dbglog("\nset up class syntax_plugin_geotag_test"); |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - function setUp() { |
|
| 42 | - parent::setUp(); |
|
| 43 | - |
|
| 44 | - global $conf; |
|
| 45 | - $conf['allowdebug'] = 1; |
|
| 46 | - $conf['cachetime'] = -1; |
|
| 47 | - |
|
| 48 | - $data = array(); |
|
| 49 | - search($data, $conf['datadir'], 'search_allpages', array('skipacl' => true)); |
|
| 50 | - |
|
| 51 | - //dbglog($data, "pages for indexing"); |
|
| 52 | - |
|
| 53 | - $verbose = false; |
|
| 54 | - $force = false; |
|
| 55 | - foreach ($data as $val) { |
|
| 56 | - idx_addPage($val['id'], $verbose, $force); |
|
| 57 | - } |
|
| 58 | - if ($conf['allowdebug']) { |
|
| 59 | - touch(DOKU_TMP_DATA.'cache/debug.log'); |
|
| 60 | - } |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - public function tearDown() { |
|
| 64 | - parent::tearDown(); |
|
| 65 | - |
|
| 66 | - global $conf; |
|
| 67 | - // try to get the debug log after running the test, print and clear |
|
| 68 | - if ($conf['allowdebug']) { |
|
| 69 | - print "\n"; |
|
| 70 | - readfile(DOKU_TMP_DATA.'cache/debug.log'); |
|
| 71 | - unlink(DOKU_TMP_DATA.'cache/debug.log'); |
|
| 72 | - } |
|
| 73 | - } |
|
| 74 | - |
|
| 75 | - public function test_geotag(){ |
|
| 76 | - $request = new TestRequest(); |
|
| 77 | - $response = $request->get(array('id'=>'minimalgeotag'), '/doku.php'); |
|
| 78 | - |
|
| 79 | - $this->assertEquals('minimalgeotag', |
|
| 80 | - $response->queryHTML('meta[name="keywords"]')->attr('content')); |
|
| 81 | - $this->assertEquals('51.565696;5.324596', |
|
| 82 | - $response->queryHTML('meta[name="geo.position"]')->attr('content')); |
|
| 83 | - $this->assertEquals('51.565696, 5.324596', |
|
| 84 | - $response->queryHTML('meta[name="ICBM"]')->attr('content')); |
|
| 85 | - |
|
| 86 | - $this->assertTrue( |
|
| 87 | - strpos($response->getContent(), 'Geotag (location) for:') !== false, |
|
| 88 | - '"Geotag (location) for:" was not in the output' |
|
| 89 | - ); |
|
| 90 | - } |
|
| 91 | - |
|
| 92 | - public function test_fullgeotag(){ |
|
| 93 | - $request = new TestRequest(); |
|
| 94 | - $response = $request->get(array('id'=>'fullgeotag'), '/doku.php'); |
|
| 95 | - |
|
| 96 | - $this->assertEquals('fullgeotag', |
|
| 97 | - $response->queryHTML('meta[name="keywords"]')->attr('content')); |
|
| 98 | - $this->assertEquals('52.132633;5.291266;9', |
|
| 99 | - $response->queryHTML('meta[name="geo.position"]')->attr('content')); |
|
| 100 | - $this->assertEquals('52.132633, 5.291266', |
|
| 101 | - $response->queryHTML('meta[name="ICBM"]')->attr('content')); |
|
| 102 | - |
|
| 103 | - $this->assertTrue( |
|
| 104 | - strpos($response->getContent(), 'Geotag (location) for:') !== false, |
|
| 105 | - '"Geotag (location) for:" was not in the output' |
|
| 106 | - ); |
|
| 107 | - } |
|
| 26 | + protected $pluginsEnabled = array('geotag'); |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * copy data and add pages to the index. |
|
| 30 | + */ |
|
| 31 | + public static function setUpBeforeClass() { |
|
| 32 | + parent::setUpBeforeClass(); |
|
| 33 | + global $conf; |
|
| 34 | + $conf['allowdebug'] = 1; |
|
| 35 | + |
|
| 36 | + TestUtils::rcopy(TMP_DIR, dirname(__FILE__).'/data/'); |
|
| 37 | + |
|
| 38 | + dbglog("\nset up class syntax_plugin_geotag_test"); |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + function setUp() { |
|
| 42 | + parent::setUp(); |
|
| 43 | + |
|
| 44 | + global $conf; |
|
| 45 | + $conf['allowdebug'] = 1; |
|
| 46 | + $conf['cachetime'] = -1; |
|
| 47 | + |
|
| 48 | + $data = array(); |
|
| 49 | + search($data, $conf['datadir'], 'search_allpages', array('skipacl' => true)); |
|
| 50 | + |
|
| 51 | + //dbglog($data, "pages for indexing"); |
|
| 52 | + |
|
| 53 | + $verbose = false; |
|
| 54 | + $force = false; |
|
| 55 | + foreach ($data as $val) { |
|
| 56 | + idx_addPage($val['id'], $verbose, $force); |
|
| 57 | + } |
|
| 58 | + if ($conf['allowdebug']) { |
|
| 59 | + touch(DOKU_TMP_DATA.'cache/debug.log'); |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + public function tearDown() { |
|
| 64 | + parent::tearDown(); |
|
| 65 | + |
|
| 66 | + global $conf; |
|
| 67 | + // try to get the debug log after running the test, print and clear |
|
| 68 | + if ($conf['allowdebug']) { |
|
| 69 | + print "\n"; |
|
| 70 | + readfile(DOKU_TMP_DATA.'cache/debug.log'); |
|
| 71 | + unlink(DOKU_TMP_DATA.'cache/debug.log'); |
|
| 72 | + } |
|
| 73 | + } |
|
| 74 | + |
|
| 75 | + public function test_geotag(){ |
|
| 76 | + $request = new TestRequest(); |
|
| 77 | + $response = $request->get(array('id'=>'minimalgeotag'), '/doku.php'); |
|
| 78 | + |
|
| 79 | + $this->assertEquals('minimalgeotag', |
|
| 80 | + $response->queryHTML('meta[name="keywords"]')->attr('content')); |
|
| 81 | + $this->assertEquals('51.565696;5.324596', |
|
| 82 | + $response->queryHTML('meta[name="geo.position"]')->attr('content')); |
|
| 83 | + $this->assertEquals('51.565696, 5.324596', |
|
| 84 | + $response->queryHTML('meta[name="ICBM"]')->attr('content')); |
|
| 85 | + |
|
| 86 | + $this->assertTrue( |
|
| 87 | + strpos($response->getContent(), 'Geotag (location) for:') !== false, |
|
| 88 | + '"Geotag (location) for:" was not in the output' |
|
| 89 | + ); |
|
| 90 | + } |
|
| 91 | + |
|
| 92 | + public function test_fullgeotag(){ |
|
| 93 | + $request = new TestRequest(); |
|
| 94 | + $response = $request->get(array('id'=>'fullgeotag'), '/doku.php'); |
|
| 95 | + |
|
| 96 | + $this->assertEquals('fullgeotag', |
|
| 97 | + $response->queryHTML('meta[name="keywords"]')->attr('content')); |
|
| 98 | + $this->assertEquals('52.132633;5.291266;9', |
|
| 99 | + $response->queryHTML('meta[name="geo.position"]')->attr('content')); |
|
| 100 | + $this->assertEquals('52.132633, 5.291266', |
|
| 101 | + $response->queryHTML('meta[name="ICBM"]')->attr('content')); |
|
| 102 | + |
|
| 103 | + $this->assertTrue( |
|
| 104 | + strpos($response->getContent(), 'Geotag (location) for:') !== false, |
|
| 105 | + '"Geotag (location) for:" was not in the output' |
|
| 106 | + ); |
|
| 107 | + } |
|
| 108 | 108 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | global $conf; |
| 34 | 34 | $conf['allowdebug'] = 1; |
| 35 | 35 | |
| 36 | - TestUtils::rcopy(TMP_DIR, dirname(__FILE__).'/data/'); |
|
| 36 | + TestUtils::rcopy(TMP_DIR, dirname(__FILE__) . '/data/'); |
|
| 37 | 37 | |
| 38 | 38 | dbglog("\nset up class syntax_plugin_geotag_test"); |
| 39 | 39 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | idx_addPage($val['id'], $verbose, $force); |
| 57 | 57 | } |
| 58 | 58 | if ($conf['allowdebug']) { |
| 59 | - touch(DOKU_TMP_DATA.'cache/debug.log'); |
|
| 59 | + touch(DOKU_TMP_DATA . 'cache/debug.log'); |
|
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | // try to get the debug log after running the test, print and clear |
| 68 | 68 | if ($conf['allowdebug']) { |
| 69 | 69 | print "\n"; |
| 70 | - readfile(DOKU_TMP_DATA.'cache/debug.log'); |
|
| 71 | - unlink(DOKU_TMP_DATA.'cache/debug.log'); |
|
| 70 | + readfile(DOKU_TMP_DATA . 'cache/debug.log'); |
|
| 71 | + unlink(DOKU_TMP_DATA . 'cache/debug.log'); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - public function test_geotag(){ |
|
| 75 | + public function test_geotag() { |
|
| 76 | 76 | $request = new TestRequest(); |
| 77 | 77 | $response = $request->get(array('id'=>'minimalgeotag'), '/doku.php'); |
| 78 | 78 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | ); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - public function test_fullgeotag(){ |
|
| 92 | + public function test_fullgeotag() { |
|
| 93 | 93 | $request = new TestRequest(); |
| 94 | 94 | $response = $request->get(array('id'=>'fullgeotag'), '/doku.php'); |
| 95 | 95 | |