public function testNestedCollectionLoad() {
$content = 'foobar';
$count = 0;
$matches = array();
$filter = new CallablesFilter(function ($asset) use ($content, &$matches, &$count) {
++$count;
if ($content == $asset
->getContent()) {
$matches[] = $asset;
}
});
$innerColl = new AssetCollection(array(
new StringAsset($content),
));
$outerColl = new AssetCollection(array(
$innerColl,
), array(
$filter,
));
$outerColl
->load();
$this
->assertEquals(1, count($matches), '->load() applies filters to leaves');
$this
->assertEquals(1, $count, '->load() applies filters to leaves only');
}