Xataface
2.0alpha2
Xataface Application Framework
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
HTML
QuickForm
tests
QuickForm_table_tests.php
Go to the documentation of this file.
1
<?php
2
ini_set(
'include_path'
, dirname(__FILE__).
'/../../..:'
.dirname(__FILE__).
'/../../../lib:'
.ini_get(
'include_path'
));
3
4
require_once
'PHPUnit.php'
;
5
6
require_once
'HTML/QuickForm/table.php'
;
7
require_once
'HTML/QuickForm/text.php'
;
8
9
10
class
QuickForm_table_test
extends
PHPUnit_TestCase {
11
12
var
$el
;
13
14
function
QuickForm_table_test
( $name =
'QuickForm_table_test'
){
15
$this->PHPUnit_TestCase($name);
16
}
17
18
function
setUp
(){
19
$this->el =
new
HTML_QuickForm_table
(
'test_table'
,
'Testing'
);
20
$this->el->addField(
new
HTML_QuickForm_text(
'fname'
,
'First Name'
));
21
$this->el->addField(
new
HTML_QuickForm_text(
'lname'
,
'Last Name'
));
22
23
24
}
25
26
function
tearDown
(){
27
28
29
}
30
31
function
test_Html
(){
32
$this->assertEquals($this->el->toHtml(),
''
);
33
34
}
35
36
37
function
test_Html_with_values
(){
38
$el
= unserialize(serialize($this->el));
39
$el
->setName(
'test_table_2'
);
40
41
$el
->setValue(
42
array(
43
array(
'fname'
=>
'John'
,
'lname'
=>
'Stamos'
),
44
array(
'fname'
=>
'Sally'
,
'lname'
=>
'Field'
),
45
array(
'fname'
=>
'Steve'
,
'lname'
=>
'Field'
)
46
)
47
);
48
$this->assertEquals(
$el
->toHtml(),
''
);
49
}
50
51
52
53
}
54
55
$test
=
new
PHPUnit_TestSuite(
'QuickForm_table_test'
);
56
57
$result
= PHPUnit::run(
$test
);
58
59
print
$result
->toString();
60
61
62
?>
Generated on Fri Mar 22 2013 09:40:34 for Xataface by
1.8.1.2