예제 #1
0
 /**
  */
 public function testTwips()
 {
     $value = rand(1, 100);
     // Centimeters
     $this->assertEquals(0, Drawing::centimetersToTwips());
     $this->assertEquals($value * 566.928, Drawing::centimetersToTwips($value));
     $this->assertEquals(0, Drawing::twipsToCentimeters());
     $this->assertEquals($value / 566.928, Drawing::twipsToCentimeters($value));
     // Inches
     $this->assertEquals(0, Drawing::inchesToTwips());
     $this->assertEquals($value * 1440, Drawing::inchesToTwips($value));
     $this->assertEquals(0, Drawing::twipsToInches());
     $this->assertEquals($value / 1440, Drawing::twipsToInches($value));
     // Pixels
     $this->assertEquals(0, Drawing::twipsToPixels());
     $this->assertEquals(round($value / 15.873984), Drawing::twipsToPixels($value));
 }