@dataProvider getPatternsAndEmpty
public function testIteration($pattern, $empty) {
$resource = new DirectoryResource(__DIR__, $pattern);
$count = 0;
foreach ($resource as $r) {
++$count;
$this
->assertInstanceOf('Assetic\\Factory\\Resource\\ResourceInterface', $r);
}
if ($empty) {
$this
->assertEmpty($count);
}
else {
$this
->assertNotEmpty($count);
}
}