Passed
Push — master ( 5555d3...9963ba )
by Brian
01:04 queued 11s
created

TestForm   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 32
ccs 0
cts 16
cp 0
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 23 1
1
<?php
2
/**
3
 * TestForm
4
 */
5
6
namespace Fr3nch13\Jira\Form;
7
8
use Cake\Event\EventManager;
9
use Fr3nch13\Jira\Exception\Exception;
10
use Fr3nch13\Jira\Form\AppForm;
11
use Fr3nch13\Jira\Lib\JiraProject;
12
13
/**
14
 * Test Form
15
 *
16
 * Used to submit a Test to Jira.
17
 * This is mainly used for 2 reasons.
18
 * - An example of how to add another type othen than a Bug or FeatureRequest.
19
 * - Used by the unit tests to make sure a non-standard type is still working.
20
 */
21
class TestForm extends AppForm
22
{
23
    /**
24
     * Constructor
25
     *
26
     * @param \Cake\Event\EventManager|null $eventManager The event manager.
27
     *  Defaults to a new instance.
28
     * @return void
29
     */
30
    public function __construct(EventManager $eventManager = null)
31
    {
32
        $this->issueType = 'Test';
33
34
        $this->settings = [
35
            // a valid Jira issue type
36
            'jiraType' => 'Task',
37
            // any labels that you want that issue tagged with. space seperated string, or an array.
38
            'jiraLabels' => 'test-label',
39
            // data used in this form.
40
            'formData' => [
41
                // define the fields here for the HtmlHelper::control()
42
                'fields' => [
43
                    // this is really the only required field.
44
                    'summary' => [
45
                        'type' => 'string',
46
                        'required' => true
47
                    ]
48
                ]
49
            ]
50
        ];
51
52
        parent::__construct($eventManager);
53
    }
54
}
55