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'); }
public function setting(EditorHandler $handler, Request $request, $instanceId) { $editorId = $request->get('editorId'); if (empty($editorId)) { $editorId = null; } $handler->setInstance($instanceId, $editorId); if (!($url = XeMenu::getInstanceSettingURIByItemId($instanceId))) { return redirect()->back(); } else { return redirect($url); } }