AbstractSlideTest.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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\Slide;
  18. use PhpOffice\PhpPresentation\Shape\RichText;
  19. use PhpOffice\PhpPresentation\Slide\AbstractSlide;
  20. /**
  21. * Test class for Table element
  22. *
  23. * @coversDefaultClass PhpOffice\PhpPresentation\Shape\AbstractGraphic
  24. */
  25. class AbstractSlideTest extends \PHPUnit_Framework_TestCase
  26. {
  27. public function testCollection()
  28. {
  29. /** @var AbstractSlide $stub */
  30. $stub = $this->getMockForAbstractClass('PhpOffice\\PhpPresentation\\Slide\\AbstractSlide');
  31. $array = array();
  32. $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\AbstractSlide', $stub->setShapeCollection($array));
  33. $this->assertInternalType('array', $stub->getShapeCollection());
  34. $this->assertCount(count($array), $stub->getShapeCollection());
  35. $array = array(
  36. new RichText(),
  37. new RichText(),
  38. new RichText(),
  39. );
  40. $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\AbstractSlide', $stub->setShapeCollection($array));
  41. $this->assertInternalType('array', $stub->getShapeCollection());
  42. $this->assertCount(count($array), $stub->getShapeCollection());
  43. }
  44. }