@@ -85,10 +85,10 @@ public function testWriteColSpan()
85
85
$ section = $ phpWord ->addSection ();
86
86
$ table = $ section ->addTable ();
87
87
$ row1 = $ table ->addRow ();
88
- $ cell11 = $ row1 ->addCell (1000 , array ('gridSpan ' => 2 ));
88
+ $ cell11 = $ row1 ->addCell (1000 , array ('gridSpan ' => 2 , ' bgColor ' => ' 6086B8 ' ));
89
89
$ cell11 ->addText ('cell spanning 2 bellow ' );
90
90
$ row2 = $ table ->addRow ();
91
- $ cell21 = $ row2 ->addCell (500 );
91
+ $ cell21 = $ row2 ->addCell (500 , array ( ' bgColor ' => ' ffffff ' ) );
92
92
$ cell21 ->addText ('first cell ' );
93
93
$ cell22 = $ row2 ->addCell (500 );
94
94
$ cell22 ->addText ('second cell ' );
@@ -99,6 +99,11 @@ public function testWriteColSpan()
99
99
$ this ->assertTrue ($ xpath ->query ('/html/body/table/tr[1]/td ' )->length == 1 );
100
100
$ this ->assertEquals ('2 ' , $ xpath ->query ('/html/body/table/tr/td[1] ' )->item (0 )->attributes ->getNamedItem ('colspan ' )->textContent );
101
101
$ this ->assertTrue ($ xpath ->query ('/html/body/table/tr[2]/td ' )->length == 2 );
102
+
103
+ $ this ->assertEquals ('#6086B8 ' , $ xpath ->query ('/html/body/table/tr[1]/td ' )->item (0 )->attributes ->getNamedItem ('bgcolor ' )->textContent );
104
+ $ this ->assertEquals ('#ffffff ' , $ xpath ->query ('/html/body/table/tr[1]/td ' )->item (0 )->attributes ->getNamedItem ('color ' )->textContent );
105
+ $ this ->assertEquals ('#ffffff ' , $ xpath ->query ('/html/body/table/tr[2]/td ' )->item (0 )->attributes ->getNamedItem ('bgcolor ' )->textContent );
106
+ $ this ->assertNull ($ xpath ->query ('/html/body/table/tr[2]/td ' )->item (0 )->attributes ->getNamedItem ('color ' ));
102
107
}
103
108
104
109
/**
0 commit comments