Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 65 lines (59 sloc) 0.965 kb
55664eb tests for thead/tfoot/tbody support
Mark Wiesemann authored
1 --TEST--
f768577 - test 24 didn't make sense (invalid (X)HTML code and not useful); now
Mark Wiesemann authored
2 24.phpt: thead, tfoot, 2 tbodies (with ids) and addRow
55664eb tests for thead/tfoot/tbody support
Mark Wiesemann authored
3 --FILE--
4 <?php
5 // $Id$
6 require_once 'HTML/Table.php';
e1c7a95 - Request #16984: added a __toString() method, i.e. "echo $table;" is no...
Mark Wiesemann authored
7 $table = new HTML_Table();
55664eb tests for thead/tfoot/tbody support
Mark Wiesemann authored
8
9 $thead =& $table->getHeader();
10 $tfoot =& $table->getFooter();
11
f768577 - test 24 didn't make sense (invalid (X)HTML code and not useful); now
Mark Wiesemann authored
12 $tbody1 =& $table->getBody(1);
13 $tbody1->setAttribute('id', 'tbody1');
14
15 $tbody2 =& $table->getBody(2);
16 $tbody2->setAttribute('id', 'tbody2');
17
55664eb tests for thead/tfoot/tbody support
Mark Wiesemann authored
18 $data[0][] = 'Test';
19 $data[1][] = 'Test';
20
21 foreach($data as $key => $value) {
22 $thead->addRow($value);
23 $tfoot->addRow($value);
f768577 - test 24 didn't make sense (invalid (X)HTML code and not useful); now
Mark Wiesemann authored
24 $tbody1->addRow($value);
25 $tbody2->addRow($value);
55664eb tests for thead/tfoot/tbody support
Mark Wiesemann authored
26 }
27
28 // output
29 echo $table->toHTML();
30 ?>
31 --EXPECT--
32 <table>
33 <thead>
34 <tr>
35 <td>Test</td>
36 </tr>
37 <tr>
38 <td>Test</td>
39 </tr>
40 </thead>
41 <tfoot>
42 <tr>
43 <td>Test</td>
44 </tr>
45 <tr>
46 <td>Test</td>
47 </tr>
48 </tfoot>
f768577 - test 24 didn't make sense (invalid (X)HTML code and not useful); now
Mark Wiesemann authored
49 <tbody id="tbody1">
50 <tr>
51 <td>Test</td>
52 </tr>
53 <tr>
54 <td>Test</td>
55 </tr>
56 </tbody>
57 <tbody id="tbody2">
58 <tr>
59 <td>Test</td>
60 </tr>
61 <tr>
62 <td>Test</td>
63 </tr>
64 </tbody>
55664eb tests for thead/tfoot/tbody support
Mark Wiesemann authored
65 </table>
Something went wrong with that request. Please try again.