public function AssetCollectionTest::testGetLastModified

@dataProvider getTimestampsAndExpected

File

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

Class

AssetCollectionTest

Namespace

Assetic\Test\Asset

Code

public function testGetLastModified($timestamps, $expected) {
  $assets = array();
  for ($i = 0; $i < count($timestamps); $i++) {
    $asset = $this
      ->getMock('Assetic\\Asset\\AssetInterface');
    $asset
      ->expects($this
      ->once())
      ->method('getLastModified')
      ->will($this
      ->returnValue($timestamps[$i]));
    $assets[$i] = $asset;
  }
  $coll = new AssetCollection($assets);
  $this
    ->assertEquals($expected, $coll
    ->getLastModified(), '->getLastModifed() returns the highest last modified');
}