public function setInstance($instanceId, $editorId)
{
if ($editorId !== null && !$this->register->get($editorId)) {
throw new EditorNotFoundException();
}
$this->configManager->set(self::MAP_CONFIG_NAME, [$instanceId => $editorId]);
}
public function testSetInstance() { list($register, $configs, $container, $storage, $medias, $tags) = $this->getMocks(); $instance = new EditorHandler($register, $configs, $container, $storage, $medias, $tags); $register->shouldReceive('get')->once()->with('editor/foo@bar')->andReturn('stdClass'); $configs->shouldReceive('set')->once()->with(EditorHandler::MAP_CONFIG_NAME, ['someinstanceid' => 'editor/foo@bar']); $instance->setInstance('someinstanceid', 'editor/foo@bar'); }