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