JSArrayTest.php 547 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace vierbergenlars\SemVer\Tests;
  3. use PHPUnit\Framework\TestCase;
  4. use vierbergenlars\LibJs\JSArray;
  5. use vierbergenlars\LibJs\JString;
  6. /**
  7. * @copyright ResearchGate GmbH
  8. */
  9. class JSArrayTest extends TestCase
  10. {
  11. public function testIterableJSArray()
  12. {
  13. $jsArray = new JSArray(array('1.0.0', '2.0.0'));
  14. $versions = array();
  15. foreach ($jsArray as $version) {
  16. $versions[] = $version;
  17. }
  18. $this->assertEquals(array(new JString('1.0.0'), new JString('2.0.0')), $versions);
  19. }
  20. }