public function merge($resources) { Assert::allIsInstanceOf($resources, 'Puli\\Repository\\Api\\Resource\\PuliResource'); // only start merging after validating all resources foreach ($resources as $resource) { $this->resources[] = $resource; } }
/** * @expectedException \InvalidArgumentException */ public function testMergeFailsIfNoResource() { $collection = new ArrayResourceCollection(); $collection->merge(array('foobar')); }