How to use setRootUrl method of html class

Best Atoum code snippet using html.setRootUrl

SystemConfigController.php

Source:SystemConfigController.php Github

copy

Full Screen

...45 {46 }47 public function addNetworkAction(Request $request)48 {49 Cyclos\Configuration::setRootUrl("http://localhost:8080/cyclos/global");50 Cyclos\Configuration::setAuthentication("mazouthm", "admin"); 51 // $network = new Network();52 $networkDTO = array();53 $initialData = new \stdClass();54// $em = $this->getDoctrine()->getManager();55// $form = $this->get('form.factory')->create(NetworkType::class, $network);56 $form = $this->createFormBuilder($networkDTO)57 ->add('name' , TextType::class , array('label' => 'nom du réseau')) 58 ->add('enabled' , CheckboxType::class, array('label' => 'Réseau opérationnel', 'required' => false))59 ->add('currencyName' , TextType::class , array('label' => 'Monnaie')) 60 ->add('currencySymbol', TextType::class , array('label' => 'Symbole')) 61 ->add('userAccount' , TextType::class , array('label' => 'nom du compte utilisateur')) 62 ->add('systemAccount' , TextType::class , array('label' => 'nom du compte système')) 63 ->add('save' , SubmitType::class) 64 ->getForm()65 ; 66 if($request->isMethod('POST')){ //form filled and submitted67 $form->handleRequest($request); 68 if($form->isValid()){69 $dataForm = $form->getData();70 $networkDTO = (object) $dataForm;71 $networkDTO->internalName = preg_replace('/\s\s+/', '', $networkDTO->name); 72// $DTO = $network->fromEntityToDTO();73 $initialData->currencyName = $dataForm['currencyName'];74 $initialData->currencySymbol = $dataForm['currencySymbol'];75 $initialData->userAccount = $dataForm['userAccount'];76 $initialData->systemAccount = $dataForm['systemAccount'];77 $networkID = $this->networkManager->addNetwork($networkDTO,$initialData);78// $network->setCyclosID($networkID);79//80// $em->persist($network);81// $em->flush();82 return $this->render('CairnUserCyclosBundle:Config/Network:index.html.twig');83 }84 }85 return $this->render('CairnUserCyclosBundle:Config/Network:add.html.twig', array('form' => $form->createView()));86 }87 public function editNetworkAction(Request $request, $name)88 {89 Cyclos\Configuration::setRootUrl("http://localhost:8080/cyclos/global");90 Cyclos\Configuration::setAuthentication("mazouthm", "admin"); 91 $networkDTO = $this->get('cairn_user_cyclos_network_info')->getNetworkDTO($name);92 $networkArray = json_decode(json_encode($networkDTO), true);93 $form = $this->createFormBuilder($networkArray)94 ->add('name' , TextType::class , array('label' => 'nom du réseau')) 95 ->add('enabled' , CheckboxType::class, array('label' => 'Réseau opérationnel', 'required' => false))96 ->add('save' , SubmitType::class) 97 ->getForm()98 ; 99 if($request->isMethod('POST')){ //form filled and submitted100 $form->handleRequest($request); 101 if($form->isValid()){102 $dataForm = $form->getData();103 $networkDTO = (object) $dataForm;104 $networkDTO->internalName = preg_replace('/\s\s+/', '', $networkDTO->name); 105 $networkID = $this->networkManager->editNetwork($networkDTO);106 return $this->render('CairnUserCyclosBundle:Config/Network:index.html.twig');107 }108 }109 return $this->render('CairnUserCyclosBundle:Config/Network:edit.html.twig', array('form' => $form->createView()));110 }111 public function removeNetworkAction(Request $request, $name)112 {113 Cyclos\Configuration::setRootUrl("http://localhost:8080/cyclos/global");114 Cyclos\Configuration::setAuthentication("mazouthm", "admin"); 115 $networkID = $this->get('cairn_user_cyclos_network_info')->getNetworkID($name);116 $this->networkManager->removeNetwork($networkID);117 return $this->render('CairnUserCyclosBundle:Config/Network:index.html.twig');118 }119 public function switchToNetworkAction($name)120 {121 if ($name == 'globalAdmin'){122 $internalName = 'global';123 }124 else{125 $network = $this->get('cairn_user_cyclos_network_info')->getNetworkData($name);126 $internalName = $network->dto->internalName;127 }128 Cyclos\Configuration::setRootUrl('http://127.0.0.1:8080/cyclos/' . $internalName);129 return new Response('Switch to network ' . $name);130 }131 public function addGroupAction(Request $request)132 {133 Cyclos\Configuration::setRootUrl("http://localhost:8080/cyclos/global");134 Cyclos\Configuration::setAuthentication("mazouthm", "admin"); 135 //org.cyclos.model.users.groups.AdminGroupDTO 136 $groupID = $this->get('cairn_user_cyclos_group_info')->getGroupID('groupTest');137 $group = new \stdClass();138 $group->id = $groupID;139 $group->type = 'admin';140 try{141 $groupData = $this->groupManager->addGroup($groupID);142 $groupData->dto->nature = 'MEMBER_GROUP'; 143 $groupData->dto->internalName = 'groupTest2';144 $groupData->dto->name = $groupData->dto->internalName;145 $groupData->dto->id = $groupData->dto->id + 10; 146 $this->groupManager->saveGroup($groupData->dto);147 // $group->id = $id;148 // $group->managedNetworks = array('Test2','Test');149 // $group->name = 'Tullins';150 // $group->internalName = $group->name;151 // $group->enabled = true;152 // $group->nature = "adminGroup";153 // $group->adminType = 'network';154 // $group->canRegisterNetworks = false;155 }catch(\Exception $e){156 // print_r($gd);157 echo 'Erreur :' . $e->getMessage(); 158 print_r($e->error);159 }160 return new Response(print_r($groupData->dto) . 'Groupe ajouté');161 }162 public function removeGroupAction($name)163 {164 }165 /*166 *technique to add new entity : get entityData with getDataFromNew then retrieve dto, fill properties and save167 *168 */169 public function addTransferTypeAction()170 {171 Cyclos\Configuration::setRootUrl("http://localhost:8080/cyclos/global");172 Cyclos\Configuration::setAuthentication("mazouthm", "admin"); 173 $this->switchToNetworkAction('Test5');174 $dataParams = new \stdClass();175 $dataParams->nature = 'PAYMENT';176 $dataParams->fromAccountType = 'organization';177 try{178 $data = $this->transferTypeManager->dataForNew($dataParams); 179 $newDTO = $data->dto;180 $newDTO->name = 'testTransferType';181 $newDTO->channels[] = 'webServices';182 $newDTO->allowsRecurringPayments = true; 183 $newDTO->to = new \stdClass();184 $newDTO->to->nature = 'USER';185 $newDTO->to->internalName = 'test';186 $this->transferTypeManager->saveTransferType($newDTO);187 }catch(\Exception $e){188 echo 'Erreur :' . $e->getMessage(); 189 print_r($e->error);190 }191 return new Response(print_r($data->dto) . 'TransferType récupéré');192 }193 /*194 *configure all the transfer types by allowing WebServices channel195 *196 */197 public function configureTransferTypesAction()198 {199 Cyclos\Configuration::setRootUrl("http://localhost:8080/cyclos/global");200 Cyclos\Configuration::setAuthentication("mazouthm", "admin"); 201 $this->switchToNetworkAction('Test5');202 try{203 $this->transferTypeManager->configureTransferTypes();204 }catch(\Exception $e){205 echo 'Erreur :' . $e->getMessage(); 206 print_r($e->error);207 }208 return new Response('TransferTypes configurés pour les WebServices');209 }210 /*211 *makes payment from debit account to $userAccount212 *@param string $name213 *214 */215 public function makePaymentAction(Request $request)216 {217 Cyclos\Configuration::setRootUrl("http://localhost:8080/cyclos/global");218 Cyclos\Configuration::setAuthentication("mazouthm", "admin"); 219 $this->switchToNetworkAction('Test5');220 $from = $request->query->get('from');221 $to = $request->query->get('to');222 $type = $request->query->get('type');223 $amount = $request->query->get('amount');224 $transferType = $this->get('cairn_user_cyclos_banking_info')->getTransferType($type);225 $bankingService = $this->get('cairn_user_cyclos_banking_info');226 try{227 if(($type == 'credit') || ($type == 'systemToUser')){228 $paymentData = $bankingService->getPaymentData('SYSTEM',array('username' => $to),$transferType);229 }230 elseif(($type == 'debit') || ($type == 'userToSystem')){231 $paymentData = $bankingService->getPaymentData(array('username' => $from),'SYSTEM',$transferType);...

Full Screen

Full Screen

GetSitemapUrlTest.php

Source:GetSitemapUrlTest.php Github

copy

Full Screen

...11 * in robots.txt and served as application/xml12 * 13 */14 public function testGetSitemapXmlAsApplicationXmlViaRobotsTxt() { 15 $this->getSitemapFinder()->getConfiguration()->setRootUrl('http://webignition.net');16 17 $sitemaps = $this->getSitemapFinder()->getSitemaps();18 $this->assertEquals('http://webignition.net/sitemap.xml', $sitemaps[0]->getUrl()); 19 }20 21 22 public function testGetSitemapXmlAsApplicationXmlFromRelativeUrlViaRobotsTxt() {23 $this->getSitemapFinder()->getConfiguration()->setRootUrl('http://webignition.net');24 25 $sitemaps = $this->getSitemapFinder()->getSitemaps();26 $this->assertEquals('http://webignition.net/sitemap.xml', $sitemaps[0]->getUrl()); 27 }28 29 30 /**31 * Test finding the sitemap.xml URL via the sitemap URL being referenced32 * in robots.txt and served as text/xml33 * 34 */35 public function testGetSitemapXmlAsTextXmlViaRobotsTxt() { 36 $this->getSitemapFinder()->getConfiguration()->setRootUrl('http://webignition.net'); 37 $sitemaps = $this->getSitemapFinder()->getSitemaps();38 $this->assertEquals('http://webignition.net/sitemap.xml', $sitemaps[0]->getUrl());39 } 40 41 42 /**43 * Test finding the sitemap.txt URL via the sitemap URL being referenced44 * in robots.txt and served as text/plain45 * 46 */47 public function testGetSitemapTxtAsTextPlainViaRobotsTxt() { 48 $this->getSitemapFinder()->getConfiguration()->setRootUrl('http://webignition.net'); 49 $sitemaps = $this->getSitemapFinder()->getSitemaps(); 50 $this->assertEquals('http://webignition.net/sitemap.txt', $sitemaps[0]->getUrl()); 51 } 52 53 54 /**55 * Test finding the sitemap.xml.gz URL via the sitemap URL being referenced56 * in robots.txt and served as application/x-gzip57 * 58 */59 public function testGetSitemapXmlGzAsApplicationXGzipViaRobotsTxt() { 60 $this->getSitemapFinder()->getConfiguration()->setRootUrl('http://www.ominocity.com'); 61 $sitemaps = $this->getSitemapFinder()->getSitemaps();62 $this->assertEquals('http://www.ominocity.com/sitemap.xml.gz', $sitemaps[0]->getUrl()); 63 }64 65 66 /**67 * Test finding the sitemap.xml URL via the site root and served as application/xml68 * 69 */70 public function testGetSitemapXmlAsApplicationXmlViaSiteRoot() { 71 $this->getSitemapFinder()->getConfiguration()->setRootUrl('http://webignition.net'); 72 $sitemaps = $this->getSitemapFinder()->getSitemaps(); 73 $this->assertEquals('http://webignition.net/sitemap.xml', $sitemaps[0]->getUrl());74 } 75 76 77 /**78 * Test finding the sitemap.xml URL via the site root and served as text/xml79 * 80 */81 public function testGetSitemapXmlAsTextXmlViaSiteRoot() { 82 $this->getSitemapFinder()->getConfiguration()->setRootUrl('http://webignition.net'); 83 $sitemaps = $this->getSitemapFinder()->getSitemaps();84 $this->assertEquals('http://webignition.net/sitemap.xml', $sitemaps[0]->getUrl());85 } 86 87 88 /**89 * Test finding the sitemap.txt URL via the site root and served as text/plain90 * 91 */92 public function testGetSitemapTxtAsTextPlainViaSiteRoot() { 93 $this->getSitemapFinder()->getConfiguration()->setRootUrl('http://webignition.net'); 94 $sitemaps = $this->getSitemapFinder()->getSitemaps();95 $this->assertEquals('http://webignition.net/sitemap.txt', $sitemaps[0]->getUrl()); 96 }97 98 99 /**100 * Test finding sitemap URL that is an ATOM feed via robots.txt101 * 102 */103 public function testGetSitemapAtomFeedAsApplicationAtomPlusXmlViaRobotsTxt() { 104 $this->getSitemapFinder()->getConfiguration()->setRootUrl('http://blogsofnote.blogspot.co.uk'); 105 $sitemaps = $this->getSitemapFinder()->getSitemaps();106 107 $this->assertEquals('http://blogsofnote.blogspot.com/feeds/posts/default?orderby=UPDATED', $sitemaps[0]->getUrl()); 108 }109 110 111 /**112 * Test finding XML sitemap via robots.txt for site protected with http auth113 * 114 */115 public function testForHttpAuthProtectedSite() {116 $this->getSitemapFinder()->getConfiguration()->setRootUrl('http://example.com/');117 $this->getSitemapFinder()->getConfiguration()->getBaseRequest()->setAuth('example', 'password', 'any');118 $sitemaps = $this->getSitemapFinder()->getSitemaps();119 120 $this->assertEquals(1, count($sitemaps));121 $this->assertEquals(array(122 'http://example.com/index.html'123 ), $sitemaps[0]->getUrls());124 } 125 126}...

Full Screen

Full Screen

ExpectedRobotsTxtFileUrlTest.php

Source:ExpectedRobotsTxtFileUrlTest.php Github

copy

Full Screen

...4 public function testGetExpectedRobotsTxtFileUrlTest() {5 6 $finder = new \webignition\WebsiteSitemapFinder\WebsiteSitemapFinder(); 7 8 $finder->getConfiguration()->setRootUrl('http://example.com/'); 9 $this->assertEquals('http://example.com/robots.txt', $finder->getExpectedRobotsTxtFileUrl());10 11 $finder->getConfiguration()->setRootUrl('http://example.com/index.html'); 12 $this->assertEquals('http://example.com/robots.txt', $finder->getExpectedRobotsTxtFileUrl());13 14 $finder->getConfiguration()->setRootUrl('http://example.com/path/to/application/index.php'); 15 $this->assertEquals('http://example.com/robots.txt', $finder->getExpectedRobotsTxtFileUrl()); 16 }17 18}...

Full Screen

Full Screen

setRootUrl

Using AI Code Generation

copy

Full Screen

1$rootUrl = $this->objConfig->getsiteRoot();2$objHead->setRootUrl($rootUrl);3$objHead->putJavaScriptFile('js/jquery.js');4$objHead->putJavaScriptFile('js/jquery-ui.js');5$objHead->putJavaScriptFile('js/jquery.ui.datepicker.js');6$objHead->putJavaScriptFile('js/jquery.ui.datepicker-en.js');7$objHead->putJavaScriptFile('js/jquery.ui.core.js');8$objHead->putJavaScriptFile('js/jquery.ui.widget.js');9$objHead->putJavaScriptFile('js/jquery.ui.mouse.js');10$objHead->putJavaScriptFile('js/jquery.ui.draggable.js');11$objHead->putJavaScriptFile('js/jquery.ui.droppable.js');12$objHead->putJavaScriptFile('js/jquery.ui.resizable.js');13$objHead->putJavaScriptFile('js/jquery.ui.position.js');14$objHead->putJavaScriptFile('js/jquery.ui.slider.js');15$objHead->putJavaScriptFile('js/jquery.ui.tabs.js');16$objHead->putJavaScriptFile('js/jquery.ui.accordion.js');17$objHead->putJavaScriptFile('js/jquery.ui.autocomplete.js');18$objHead->putJavaScriptFile('js/jquery.ui.button.js');19$objHead->putJavaScriptFile('js/jquery.ui.dialog.js');20$objHead->putJavaScriptFile('js/jquery.ui.effect.js');21$objHead->putJavaScriptFile('js/jquery.ui.effect-blind.js');22$objHead->putJavaScriptFile('js/jquery.ui.effect-bounce.js');23$objHead->putJavaScriptFile('js/jquery.ui.effect-clip.js');24$objHead->putJavaScriptFile('js/jquery.ui.effect-drop.js');25$objHead->putJavaScriptFile('js/jquery.ui.effect-explode.js');26$objHead->putJavaScriptFile('js/jquery.ui.effect-fade.js');27$objHead->putJavaScriptFile('js/jquery.ui.effect-fold.js');28$objHead->putJavaScriptFile('js/jquery.ui.effect-highlight.js');29$objHead->putJavaScriptFile('js/jquery.ui.effect-puff.js');30$objHead->putJavaScriptFile('js/jquery.ui.effect-pulsate.js');31$objHead->putJavaScriptFile('js/jquery.ui.effect-scale.js');32$objHead->putJavaScriptFile('js/jquery.ui.effect-shake.js');33$objHead->putJavaScriptFile('js/jquery.ui.effect-slide.js');34$objHead->putJavaScriptFile('js/jquery.ui.menu.js');35$objHead->putJavaScriptFile('js/jquery.ui.progressbar.js');36$objHead->putJavaScriptFile('js/jquery.ui.selectable.js');

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful