当前位置: 首页>>代码示例>>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;未经允许,请勿转载。