public function testWorkerReturn() {
$worker = $this
->getMock('Assetic\\Factory\\Worker\\WorkerInterface');
$asset = $this
->getMock('Assetic\\Asset\\AssetInterface');
$worker
->expects($this
->at(2))
->method('process')
->with($this
->isInstanceOf('Assetic\\Asset\\AssetCollectionInterface'))
->will($this
->returnValue($asset));
$this->factory
->addWorker($worker);
$coll = $this->factory
->createAsset(array(
'foo.js',
'bar.js',
));
$this
->assertEquals(1, count(iterator_to_array($coll)));
}