This repository has been archived by the owner on Nov 26, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 298
/
JFormFieldEditorTest.php
78 lines (69 loc) · 1.65 KB
/
JFormFieldEditorTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* @package Joomla.UnitTest
* @subpackage Form
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
/**
* Test class for JFormFieldEditor.
*
* @package Joomla.UnitTest
* @subpackage Form
* @since 11.1
*/
class JFormFieldEditorTest extends TestCaseDatabase
{
/**
* Sets up dependencies for the test.
*
* @return void
*
* @since 11.1
*/
protected function setUp()
{
require_once JPATH_TESTS . '/suites/unit/joomla/form/inspectors.php';
}
/**
* Gets the data set to be loaded into the database during setup
*
* @return xml dataset
*
* @since 12.1
*/
protected function getDataSet()
{
return $this->createXMLDataSet(__DIR__ . '/testfiles/JFormField.xml');
}
/**
* Test the getInput method.
*
* @return void
*
* @since 11.1
*/
public function testGetInput()
{
$form = new JFormInspector('form1');
$this->assertThat(
$form->load('<form><field name="editor" type="editor" /></form>'),
$this->isTrue(),
'Line:'.__LINE__.' XML string should load successfully.'
);
$field = new JFormFieldEditor($form);
$this->assertThat(
$field->setup($form->getXml()->field, 'value'),
$this->isTrue(),
'Line:'.__LINE__.' The setup method should return true.'
);
$this->markTestIncomplete('Problems encountered in next assertion');
$this->assertThat(
strlen($field->input),
$this->greaterThan(0),
'Line:'.__LINE__.' The getInput method should return something without error.'
);
// TODO: Should check all the attributes have come in properly.
}
}