当前位置: 首页>>代码示例>>PHP>>正文


PHP Sabre_DAV_Server::exposeVersion方法代码示例

本文整理汇总了PHP中Sabre_DAV_Server::exposeVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP Sabre_DAV_Server::exposeVersion方法的具体用法?PHP Sabre_DAV_Server::exposeVersion怎么用?PHP Sabre_DAV_Server::exposeVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sabre_DAV_Server的用法示例。


在下文中一共展示了Sabre_DAV_Server::exposeVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testBeforeMethodNoVersion

 function testBeforeMethodNoVersion()
 {
     if (!SABRE_HASSQLITE) {
         $this->markTestSkipped('SQLite driver is not available');
     }
     $cbackend = Sabre_CalDAV_TestUtil::getBackend();
     $pbackend = new Sabre_DAVACL_MockPrincipalBackend();
     $props = array('uri' => 'UUID-123467', 'principaluri' => 'admin', 'id' => 1);
     $tree = array(new Sabre_CalDAV_Calendar($pbackend, $cbackend, $props));
     $p = new Sabre_CalDAV_ICSExportPlugin();
     $s = new Sabre_DAV_Server($tree);
     $s->addPlugin($p);
     $s->addPlugin(new Sabre_CalDAV_Plugin());
     $h = new Sabre_HTTP_Request(array('QUERY_STRING' => 'export'));
     $s->httpRequest = $h;
     $s->httpResponse = new Sabre_HTTP_ResponseMock();
     Sabre_DAV_Server::$exposeVersion = false;
     $this->assertFalse($p->beforeMethod('GET', 'UUID-123467?export'));
     Sabre_DAV_Server::$exposeVersion = true;
     $this->assertEquals('HTTP/1.1 200 OK', $s->httpResponse->status);
     $this->assertEquals(array('Content-Type' => 'text/calendar'), $s->httpResponse->headers);
     $obj = VObject\Reader::read($s->httpResponse->body);
     $this->assertEquals(5, count($obj->children()));
     $this->assertEquals(1, count($obj->VERSION));
     $this->assertEquals(1, count($obj->CALSCALE));
     $this->assertEquals(1, count($obj->PRODID));
     $this->assertFalse(strpos((string) $obj->PRODID, Sabre_DAV_Version::VERSION) !== false);
     $this->assertEquals(1, count($obj->VTIMEZONE));
     $this->assertEquals(1, count($obj->VEVENT));
 }
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:30,代码来源:ICSExportPluginTest.php

示例2: testGeneratorNoVersion

 function testGeneratorNoVersion()
 {
     $v = Sabre_DAV_Server::$exposeVersion;
     Sabre_DAV_Server::$exposeVersion = false;
     $gen = new Sabre_VObject_FreeBusyGenerator();
     $gen->setObjects(array());
     $result = $gen->getResult();
     Sabre_DAV_Server::$exposeVersion = $v;
     $this->assertFalse(strpos($result->PRODID->value, Sabre_VObject_Version::VERSION));
 }
开发者ID:robhell,项目名称:friendica-addons,代码行数:10,代码来源:FreeBusyGeneratorTest.php


注:本文中的Sabre_DAV_Server::exposeVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。