public function AssetCollectionTest::testBasenameCollision

File

drupal/core/vendor/kriswallsmith/assetic/tests/Assetic/Test/Asset/AssetCollectionTest.php, line 244

Class

AssetCollectionTest

Namespace

Assetic\Test\Asset

Code

public function testBasenameCollision() {
  $asset1 = new StringAsset('asset1', array(), '/some/dir', 'foo/foo.css');
  $asset2 = new StringAsset('asset2', array(), '/some/dir', 'bar/foo.css');
  $coll = new AssetCollection(array(
    $asset1,
    $asset2,
  ));
  $urls = array();
  foreach ($coll as $leaf) {
    $urls[] = $leaf
      ->getTargetPath();
  }
  $this
    ->assertEquals(2, count(array_unique($urls)), 'iterator prevents basename collisions');
}