1<?php
2
3/**
4 * @group plugin_data
5 * @group plugins
6 */
7class data_action_plugin_edit_button_test extends DokuWikiTest
8{
9
10    protected $pluginsEnabled = array('data', 'sqlite');
11
12    function testSetName()
13    {
14        $action = new action_plugin_data();
15        $data = array(
16            'target' => 'plugin_data'
17        );
18        $event = new Doku_Event('', $data);
19        $action->editButton($event, null);
20
21        $this->assertTrue(isset($data['name']));
22    }
23
24    function testWrongTarget()
25    {
26        $action = new action_plugin_data();
27        $data = array(
28            'target' => 'default target'
29        );
30        $event = new Doku_Event('', $data);
31        $action->editButton($event, null);
32
33        $this->assertFalse(isset($data['name']));
34    }
35
36}
37