public function testImageResource() { $object = new MemoryDrawing(); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $object->setImageResource()); $this->assertNull($object->getImageResource()); $this->assertEquals(0, $object->getWidth()); $this->assertEquals(0, $object->getHeight()); $width = rand(1, 100); $height = rand(100, 200); $gdImage = @imagecreatetruecolor($width, $height); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $object->setImageResource($gdImage)); $this->assertTrue(is_resource($object->getImageResource())); $this->assertEquals($width, $object->getWidth()); $this->assertEquals($height, $object->getHeight()); }