AnimationTest.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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;
  18. use PhpOffice\PhpPresentation\Slide\Animation;
  19. /**
  20. * Test class for Animation
  21. *
  22. * @coversDefaultClass PhpOffice\PhpPresentation\Slide\Animation
  23. */
  24. class AnimationTest extends \PHPUnit_Framework_TestCase
  25. {
  26. public function testShape()
  27. {
  28. $oStub = $this->getMockForAbstractClass('PhpOffice\PhpPresentation\AbstractShape');
  29. $object = new Animation();
  30. $this->assertInternalType('array', $object->getShapeCollection());
  31. $this->assertCount(0, $object->getShapeCollection());
  32. $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Animation', $object->addShape($oStub));
  33. $this->assertInternalType('array', $object->getShapeCollection());
  34. $this->assertCount(1, $object->getShapeCollection());
  35. $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Animation', $object->setShapeCollection());
  36. $this->assertInternalType('array', $object->getShapeCollection());
  37. $this->assertCount(0, $object->getShapeCollection());
  38. $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Animation', $object->setShapeCollection(array($oStub)));
  39. $this->assertInternalType('array', $object->getShapeCollection());
  40. $this->assertCount(1, $object->getShapeCollection());
  41. }
  42. }