/** * {@inheritDoc} */ public function unregisterSubject($id) { if (!isset($this->subjects[$id])) { throw CollectionException::idNotUsed($id); } unset($this->subjects[$id]); }
/** * Make sure we get the message we are expecting. */ public function testIdNotUsed() { $this->assertEquals('The "test" subject unique identifier is not in use.', CollectionException::idNotUsed('test')->getMessage(), 'Make sure we get the right message.'); }