@@ -86,10 +86,10 @@ public function testWriteColSpan()
8686 $ section = $ phpWord ->addSection ();
8787 $ table = $ section ->addTable ();
8888 $ row1 = $ table ->addRow ();
89- $ cell11 = $ row1 ->addCell (1000 , array ('gridSpan ' => 2 ));
89+ $ cell11 = $ row1 ->addCell (1000 , array ('gridSpan ' => 2 , ' bgColor ' => ' 6086B8 ' ));
9090 $ cell11 ->addText ('cell spanning 2 bellow ' );
9191 $ row2 = $ table ->addRow ();
92- $ cell21 = $ row2 ->addCell (500 );
92+ $ cell21 = $ row2 ->addCell (500 , array ( ' bgColor ' => ' ffffff ' ) );
9393 $ cell21 ->addText ('first cell ' );
9494 $ cell22 = $ row2 ->addCell (500 );
9595 $ cell22 ->addText ('second cell ' );
@@ -100,6 +100,11 @@ public function testWriteColSpan()
100100 $ this ->assertEquals (1 , $ xpath ->query ('/html/body/table/tr[1]/td ' )->length );
101101 $ this ->assertEquals ('2 ' , $ xpath ->query ('/html/body/table/tr/td[1] ' )->item (0 )->attributes ->getNamedItem ('colspan ' )->textContent );
102102 $ 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 ' ));
103108 }
104109
105110 /**
0 commit comments