LineTest.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * This file is part of PHPPresentation - A pure PHP library for reading and writing
  4. * presentations documents.
  5. *
  6. * PHPPresentation is free software distributed under the terms of the GNU Lesser
  7. * General Public License version 3 as published by the Free Software Foundation.
  8. *
  9. * For the full copyright and license information, please read the LICENSE
  10. * file that was distributed with this source code. For the full list of
  11. * contributors, visit https://github.com/PHPOffice/PHPPresentation/contributors.
  12. *
  13. * @copyright 2009-2015 PHPPresentation contributors
  14. * @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
  15. * @link https://github.com/PHPOffice/PHPPresentation
  16. */
  17. namespace PhpOffice\PhpPresentation\Tests\Shape;
  18. use PhpOffice\PhpPresentation\Shape\Line;
  19. use PhpOffice\PhpPresentation\Style\Border;
  20. /**
  21. * Test class for memory drawing element
  22. *
  23. * @coversDefaultClass PhpOffice\PhpPresentation\Shape\Line
  24. */
  25. class LineTest extends \PHPUnit_Framework_TestCase
  26. {
  27. /**
  28. * Test can read
  29. */
  30. public function testConstruct()
  31. {
  32. $value = rand(1, 100);
  33. $object = new Line($value, $value, $value, $value);
  34. $this->assertEquals(Border::LINE_SINGLE, $object->getBorder()->getLineStyle());
  35. $this->assertEquals($value, $object->getOffsetX());
  36. $this->assertEquals($value, $object->getOffsetY());
  37. $this->assertEquals(0, $object->getWidth());
  38. $this->assertEquals(0, $object->getHeight());
  39. $this->assertInternalType('string', $object->getHashCode());
  40. }
  41. }