TraversableStringTest.php 823B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /*
  3. * This file is part of the Assetic package, an OpenSky project.
  4. *
  5. * (c) 2010-2011 OpenSky Project Inc
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Assetic\Test\Util;
  11. use Assetic\Util\TraversableString;
  12. class TraversableStringTest extends \PHPUnit_Framework_TestCase
  13. {
  14. public function testString()
  15. {
  16. $foo = new TraversableString('foo', array('foo', 'bar'));
  17. $this->assertEquals('foo', (string) $foo);
  18. }
  19. public function testArray()
  20. {
  21. $foo = new TraversableString('foo', array('foo', 'bar'));
  22. $values = array();
  23. foreach ($foo as $value) {
  24. $values[] = $value;
  25. }
  26. $this->assertEquals(array('foo', 'bar'), $values);
  27. }
  28. }