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


PHP CMTest_TH::createSession方法代码示例

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


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

示例1: testCreate

 public function testCreate()
 {
     new CM_Splittest_Fixture(new CM_Http_Request_Post('/foo/null'));
     new CM_Splittest_Fixture(CMTest_TH::createUser());
     try {
         new CM_Splittest_Fixture(CMTest_TH::createSession());
         $this->fail('Should not be able to create a fixture from a session');
     } catch (CM_Exception_Invalid $e) {
         $this->assertContains('Invalid fixture type', $e->getMessage());
     }
 }
开发者ID:cargomedia,项目名称:cm,代码行数:11,代码来源:CM_Splittest_FixtureTest.php

示例2: _generateWowzaData

 private function _generateWowzaData(array $streamChannels)
 {
     $jsonData = array();
     /** @var CM_Model_StreamChannel_Video $streamChannel */
     foreach ($streamChannels as $streamChannel) {
         $subscribes = array();
         /** @var CM_Model_Stream_Publish $streamPublish */
         $streamPublish = $streamChannel->getStreamPublish();
         /** @var CM_Model_Stream_Subscribe $streamSubscribe */
         foreach ($streamChannel->getStreamSubscribes() as $streamSubscribe) {
             $session = CMTest_TH::createSession($streamSubscribe->getUser());
             $subscribes[$streamSubscribe->getKey()] = array('startTimeStamp' => $streamSubscribe->getStart(), 'clientId' => $streamSubscribe->getKey(), 'data' => json_encode(array('sessionId' => $session->getId())));
         }
         $session = CMTest_TH::createSession($streamPublish->getUser());
         $jsonData[$streamChannel->getKey()] = array('startTimeStamp' => $streamPublish->getStart(), 'clientId' => $streamPublish->getKey(), 'data' => json_encode(array('sessionId' => $session->getId(), 'streamChannelType' => $streamChannel->getType())), 'subscribers' => $subscribes, 'thumbnailCount' => 2, 'width' => 480, 'height' => 720, 'wowzaIp' => ip2long('192.168.0.1'));
     }
     return json_encode($jsonData);
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:18,代码来源:WowzaTest.php

示例3: testGetSession

 public function testGetSession()
 {
     $session1 = CMTest_TH::createSession();
     $sessionId1 = $session1->getId();
     $session2 = CMTest_TH::createSession();
     $sessionId2 = $session2->getId();
     $params = new CM_Params(['foo' => $sessionId1, 'bar' => 'baz', 'baz' => $session2, 'quux' => 5]);
     $session1 = $params->getSession('foo');
     $this->assertInstanceOf('CM_Session', $session1);
     $this->assertSame($sessionId1, $session1->getId());
     $exception = $this->catchException(function () use($params) {
         $params->getSession('bar');
     });
     $this->assertInstanceOf('CM_Exception_InvalidParam', $exception);
     $this->assertSame('Session is not found', $exception->getMessage());
     $session2 = $params->getSession('baz');
     $this->assertInstanceOf('CM_Session', $session2);
     $this->assertSame($sessionId2, $session2->getId());
     $exception = $this->catchException(function () use($params) {
         $params->getSession('quux');
     });
     $this->assertInstanceOf('CM_Exception_InvalidParam', $exception);
     $this->assertSame('Invalid param type for session', $exception->getMessage());
 }
开发者ID:cargomedia,项目名称:cm,代码行数:24,代码来源:ParamsTest.php


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