當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SimpleUrl::setTarget方法代碼示例

本文整理匯總了PHP中SimpleUrl::setTarget方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleUrl::setTarget方法的具體用法?PHP SimpleUrl::setTarget怎麽用?PHP SimpleUrl::setTarget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SimpleUrl的用法示例。


在下文中一共展示了SimpleUrl::setTarget方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testDefaultFrameTargetOnForm

 function testDefaultFrameTargetOnForm()
 {
     $tag = new SimpleFormTag(array('method' => 'GET', 'action' => 'here.php', 'id' => '33'));
     $form = new SimpleForm($tag, new SimpleUrl('http://host/a/index.html'));
     $form->setDefaultTarget('frame');
     $expected = new SimpleUrl('http://host/a/here.php');
     $expected->setTarget('frame');
     $this->assertEqual($form->getAction(), $expected);
 }
開發者ID:Spark-Eleven,項目名稱:revive-adserver,代碼行數:9,代碼來源:form_test.php

示例2: testDefaultFrameTargetOnForm

 function testDefaultFrameTargetOnForm()
 {
     $page =& new MockSimplePage();
     $page->expectOnce('expandUrl', array(new SimpleUrl('here.php')));
     $page->setReturnValue('expandUrl', new SimpleUrl('http://host/here.php'));
     $tag =& new SimpleFormTag(array('method' => 'GET', 'action' => 'here.php'));
     $form =& new SimpleForm($tag, $page);
     $form->setDefaultTarget('frame');
     $expected = new SimpleUrl('http://host/here.php');
     $expected->setTarget('frame');
     $this->assertEqual($form->getAction(), $expected);
 }
開發者ID:Nikitian,項目名稱:fl-ru-damp,代碼行數:12,代碼來源:form_test.php

示例3: MockSimpleUserAgent

 function testClickLinkWithUnknownFrameStillRequestsWholePage()
 {
     $agent = new MockSimpleUserAgent();
     $agent->returns('fetchResponse', new MockSimpleHttpResponse());
     $agent->expectAt(0, 'fetchResponse', array(new SimpleUrl('http://this.com/page.html'), new SimpleGetEncoding()));
     $target = new SimpleUrl('http://this.com/new.html');
     $target->setTarget('missing');
     $agent->expectAt(1, 'fetchResponse', array($target, new SimpleGetEncoding()));
     $agent->expectCallCount('fetchResponse', 2);
     $parsed_url = new SimpleUrl('http://this.com/new.html');
     $parsed_url->setTarget('missing');
     $page = new MockSimplePage();
     $page->setReturnValue('getUrlsByLabel', array($parsed_url));
     $page->setReturnValue('hasFrames', false);
     $page->expectOnce('getUrlsByLabel', array('New'));
     $page->setReturnValue('getRaw', 'A page');
     $browser = $this->createBrowser($agent, $page);
     $browser->get('http://this.com/page.html');
     $this->assertTrue($browser->clickLink('New'));
 }
開發者ID:ngugijames,項目名稱:ThinkUp,代碼行數:20,代碼來源:browser_test.php

示例4: testTargetAttachment

 function testTargetAttachment()
 {
     $url = new SimpleUrl('http://www.site.com/home.html');
     $this->assertIdentical($url->getTarget(), false);
     $url->setTarget('A frame');
     $this->assertIdentical($url->getTarget(), 'A frame');
 }
開發者ID:PublicityPort,項目名稱:OpenCATS,代碼行數:7,代碼來源:url_test.php

示例5: testReadFrameTaggedUrlsFromFrameInFocus

 function testReadFrameTaggedUrlsFromFrameInFocus()
 {
     $frame =& new MockSimplePage();
     $by_label = new SimpleUrl('l');
     $by_label->setTarget('L');
     $frame->setReturnValue('getUrlsByLabel', array($by_label));
     $by_id = new SimpleUrl('i');
     $by_id->setTarget('I');
     $frame->setReturnValue('getUrlById', $by_id);
     $frameset =& new SimpleFrameset(new MockSimplePage());
     $frameset->addFrame($frame, 'A');
     $frameset->setFrameFocus('A');
     $this->assertIdentical($frameset->getUrlsByLabel('label'), array($by_label));
     $this->assertIdentical($frameset->getUrlById(99), $by_id);
 }
開發者ID:ready4god2513,項目名稱:Journal,代碼行數:15,代碼來源:frames_test.php


注:本文中的SimpleUrl::setTarget方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。