Skip to content

Commit 957fa14

Browse files
authored
Merge pull request #240 from annda/gh-tests
Update tests
2 parents 01578b9 + 820f7b6 commit 957fa14

23 files changed

+759
-718
lines changed

.github/workflows/dokuwiki.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: DokuWiki Default Tasks
2+
on:
3+
push:
4+
pull_request:
5+
schedule:
6+
- cron: '16 8 25 * *'
7+
8+
9+
jobs:
10+
all:
11+
uses: dokuwiki/github-action/.github/workflows/all.yml@main

.github/workflows/phpTestLinux.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

Form/DropdownElement.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace dokuwiki\plugin\data\Form;
44

5+
use dokuwiki\Form\InputElement;
56
use dokuwiki\Form\OptGroup;
67

78
/**
@@ -14,7 +15,7 @@ class DropdownElement extends \dokuwiki\Form\DropdownElement
1415
protected $values = [];
1516

1617
/** @var \dokuwiki\plugin\data\Form\OptGroup[] */
17-
protected $optGroups = array();
18+
protected $optGroups = [];
1819

1920

2021
/**
@@ -27,7 +28,7 @@ class DropdownElement extends \dokuwiki\Form\DropdownElement
2728
*/
2829
public function __construct($name, $options, $label = '')
2930
{
30-
\dokuwiki\Form\InputElement::__construct('dropdown', $name, $label);
31+
InputElement::__construct('dropdown', $name, $label);
3132
$this->rmattr('type');
3233
$this->optGroups[''] = new \dokuwiki\plugin\data\Form\OptGroup(null, $options);
3334
$this->val('');
@@ -69,7 +70,7 @@ public function val($value = null)
6970
*/
7071
public function attr($name, $value = null)
7172
{
72-
return \dokuwiki\Form\InputElement::attr($name, $value);
73+
return InputElement::attr($name, $value);
7374
}
7475

7576
/**
@@ -143,5 +144,4 @@ function ($html, OptGroup $optGroup) {
143144

144145
return $html;
145146
}
146-
147147
}

_test/action_edit_button.test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function testSetName()
1616
'target' => 'plugin_data'
1717
);
1818
$event = new Doku_Event('', $data);
19-
$action->_editbutton($event, null);
19+
$action->editButton($event, null);
2020

2121
$this->assertTrue(isset($data['name']));
2222
}
@@ -28,7 +28,7 @@ function testWrongTarget()
2828
'target' => 'default target'
2929
);
3030
$event = new Doku_Event('', $data);
31-
$action->_editbutton($event, null);
31+
$action->editButton($event, null);
3232

3333
$this->assertFalse(isset($data['name']));
3434
}

_test/action_handle.test.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99
class action_handle_test extends DokuWikiTest
1010
{
11-
1211
protected $pluginsEnabled = array('data', 'sqlite');
1312

1413
protected $action;
@@ -30,15 +29,15 @@ public function setUp(): void
3029

3130
$this->action = new action_plugin_data();
3231
$this->helper = plugin_load('helper', 'data');
33-
$this->db = $this->helper->_getDB();
32+
$this->db = $this->helper->getDB();
3433

3534
$this->db->exec(
3635
'INSERT INTO pages ( pid, page, title , class , lastmod) VALUES (?, ?, ?, ?, ?)',
3736
[1, 'test', 'title', 'class', time()]
3837
);
3938
}
4039

41-
function testHandleStillPresent()
40+
public function testHandleStillPresent()
4241
{
4342

4443
$data = array(
@@ -49,13 +48,13 @@ function testHandleStillPresent()
4948
2 => 'test'
5049
);
5150
$event = new Doku_Event('', $data);
52-
$this->action->_handle($event, null);
51+
$this->action->handle($event, null);
5352

5453
$pid = $this->getTestPageId();
5554
$this->assertFalse(!$pid);
5655
}
5756

58-
function testHandleDelete()
57+
public function testHandleDelete()
5958
{
6059
$data = array(
6160
0 => array(
@@ -66,7 +65,7 @@ function testHandleDelete()
6665
);
6766

6867
$event = new Doku_Event('', $data);
69-
$this->action->_handle($event, null);
68+
$this->action->handle($event, null);
7069

7170
$pid = $this->db->queryValue('SELECT pid FROM pages WHERE page = ?', 'test');
7271
$this->assertTrue(!$pid);

0 commit comments

Comments
 (0)