public function setCollection($name)
{
if (strlen($name) === 0) {
throw new \RuntimeException('Invalid collection name. Expected a non-empty string.');
}
$this->collection = $name;
}
/** * @expectedException \RuntimeException */ public function testNullCollection() { $item = new Item('Raw content', 'index.html', []); $item->setCollection(null); }