assertCount(1, $object->getCells()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getFill()); $value = rand(1, 100); $object = new Row($value); $this->assertCount($value, $object->getCells()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getFill()); } public function testGetCell() { $object = new Row(); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->getCell(0)); $this->assertNull($object->getCell(1000, true)); } /** * @expectedException \Exception * expectedExceptionMessage Cell number out of bounds. */ public function testGetCellException() { $object = new Row(); $object->getCell(1); } public function testNextCell() { $object = new Row(2); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->nextCell()); } /** * @expectedException \Exception * expectedExceptionMessage Cell count out of bounds. */ public function testNextCellException() { $object = new Row(); $object->nextCell(); $object->nextCell(); } /** * Test get/set hash index */ public function testSetGetHashIndex() { $object = new Row(); $value = rand(1, 100); $object->setHashIndex($value); $this->assertEquals($value, $object->getHashIndex()); } public function testGetSetFill() { $object = new Row(); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Row', $object->setFill(new Fill())); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getFill()); } public function testGetSetHeight() { $object = new Row(); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Row', $object->setHeight()); $this->assertEquals(0, $object->getHeight()); $value = rand(1, 100); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Row', $object->setHeight($value)); $this->assertEquals($value, $object->getHeight()); } }