public function testDetroy($id) { //DB::table('users')->where ('id')->delete(); $destino = Enhance::getCodeCoverageWrapper('HomeControllerClass'); $destino->destroy(id); $this->assertEquals(DB::table('users')->find(id), null); }
public function testPost_logueados() { $destino = Enhance::getCodeCoverageWrapper('logueadosControllerClass'); $destino->post_logueados(); $this->call('GET', 'logueados', array('eventos' => $cine)); $this->assertResponseOk(); }
public function testpostRegistroFalla() { $destino = Enhance::getCodeCoverageWrapper('RegistroControllerClass'); $destino->postRegistro(); $validator->fails(); $this->call('POST', '/registro'); $this->assertSessionHasErrors(); }
public function testPost_logueados() { //$cine = DB::select('select * from eventos where tipo=?',array(Input::get('tipo'))); $destino = Enhance::getCodeCoverageWrapper('logueadosControllerClass'); $destino->post_logueados(); $this->call('GET', 'logueados', array('eventos' => $cine)); $this->assertResponseOk(); }
public function testDestroy($id) { $destino = Enhance::getCodeCoverageWrapper('BorraControllerClass'); $destino->destroy($id); $this->assertEquals(User::find($id), null); $this->call('GET', 'eventosadmin'); $this->assertResponseOk(); }
protected function testSetUpLayout() { //if ( ! is_null($this->layout)){ //{ //$this->layout = View::make($this->layout); //} $destino = Enhance::getCodeCoverageWrapper('BaseControllerClass'); $destino->setUpLayout(); assertEquals($this, parent::setupLayout); }
public function testPostEventoCorrecto() { $destino = Enhance::getCodeCoverageWrapper('EventosControllerClass'); $destino->postEvento(); $eventos = new Evento(); $eventos->nombre = 'Concierto Dani Martin'; $eventos->fecha = '2014-08-01'; $eventos->hora = '23:30'; $eventos->tipo = 'musica'; $eventos->aforo = '1000'; $eventos->descripcion = 'concierto del ex-cantante de ECDL en Berja'; $eventos->save(); $this->call('POST', 'eventos'); $this->assertRedirectedToRoute('eventos'); }
public function testPostEventoCorrecto() { $destino = Enhance::getCodeCoverageWrapper('EventosControllerClass'); $destino->postEvento(); $eventos = new Evento(); $eventos->nombre = 'Concirto David Bisbal'; $eventos->fecha = '2014-08-14'; $eventos->hora = '23:00'; $eventos->tipo = 'B'; $eventos->aforo = '1000'; $eventos->descripcion = 'Concierto del famoso almeriense David Bisbal en Vera (Almeria)'; $eventos->save(); $this->call('POST', 'eventos'); $this->assertRedirectedToRoute('eventos'); }
protected function testSetUpLayout() { $destino = Enhance::getCodeCoverageWrapper('BaseControllerClass'); $destino->setUpLayout(); assertEquals($this, parent::setupLayout); }
function show_question($params) { global $REQUEST_ASSOC, $TDB, $TMS, $TPA; $q = 'select * from faq where id=' . $REQUEST_ASSOC['qid']; $TMS->AddFileSection(Common::get_fmodule_tpl_path('faq', $params['qTemplate'])); $question = $TDB->get_results($q); $question = $question[1]; $anc = $this->_tree->getNodeInfo($question['cat_id']); $question['category'] = $anc['params']['Name']; $question['ancestor'] = $anc['id']; $question['back'] = $TPA->page_link . '/~show_category/cid/' . $anc['basic']; $TMS->AddMassReplace('question', $question); $tmp = $TMS->parseSection('question'); if ($this->question_alias) { $question['Alias'] = $this->question_alias; $this->question_alias = null; } else { $question['Alias'] = Enhance::cut_words2(array($question["question"], ' ', 40, '', '...', true)); } $this->get_bones($anc, $question); return $tmp; }
function get_from($params) { return Enhance::get($params[0], array(0 => $params[1])); }
* @link www.mni.thm.de */ require_once './model.php'; jimport("lib_sj_engines.stanbolenhancer.StanbolEngineInit"); $mainframe = JFactory::getApplication('site'); $mainframe->initialise(); $languageTag = SJModel::initializeLanguage(); $enhancerURL = JRequest::getString("stanbol"); $contentText = JRequest::getString("contentText"); $rootURI = str_replace('plugins/editors-xtd/sj_enhancer/', '', JURI::root()); $session = JFactory::getSession(); $enhancements = array(); $engine = new StanbolEngine("admin", "admin"); $module = new StanbolEnhancer(); $module->setUrl($enhancerURL); $operation = new Enhance(POST, array("Content-Type" => "text/plain", "Accept" => "application/rdf+xml")); $operation->setGraphURI($rootURI); $module->registerOperation("enhance", $operation); $engine->registerModule("enhancer", $module); $model = new SJModel($engine); if ($enhancerURL && $contentText) { $enhancements = $model->enhance($contentText); $session->set("enhancements", $enhancements, "sj"); } if ($session->get("enhancements", null, "sj") != null) { $enhancements = $session->get("enhancements", null, "sj"); } ?> <head> <link rel="stylesheet" type="text/css" href ="assets/enhancer.css" /> <link rel="stylesheet" type="text/css" href ="./../../../administrator/templates/bluestork/css/template.css" />
function show_folder($params) { global $TMS, $TPA; $params["Folder"] = substr($params["Folder"], 1); $TMS->AddFileSection(Common::get_fmodule_tpl_path($this->_module_name, $params['Template'])); $TMS->AddReplace('_doc_list', 'folder', $params["Folder"]); $filesnames = XFILES::files_list($params["Folder"], 'files', $extensions, 0, true); $filecount = count($filesnames); $base = $TPA->page_link; $files = array(); for ($i = 0; $i < $filecount; $i++) { $file = $params["Folder"] . $filesnames[$i]; $path_parts = pathinfo($file); $files[] = array("path" => $base . '/~download/link/' . md5(strrev("/" . $file)), "name" => $path_parts["filename"], "ext" => $path_parts["extension"], "modified" => Enhance::date_format(filemtime($file), array('m.d.y')), "size" => XFiles::format_size(filesize($file), 2)); } for ($i = 0; $i < $filecount; $i++) { $TMS->AddMassReplace("_doc_list_item", $files[$i]); $TMS->parseSection("_doc_list_item", true); } return $TMS->parseSection('_doc_list'); }
public function testLogOut() { $destino = Enhance::getCodeCoverageWrapper('AuthControllerClass'); $destino->logOut(); $this->assertRedirectedTo('/login'); }