• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CMTest_TH类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testGetRelativePathOutOfFilesystem

 /**
  * @expectedException CM_Exception
  * @expectedExceptionMessage Path is out of filesystem directory
  */
 public function testGetRelativePathOutOfFilesystem()
 {
     $adapter = $this->getMockBuilder('CM_File_Filesystem_Adapter')->setConstructorArgs(array('/base/base2'))->getMockForAbstractClass();
     /** @var CM_File_Filesystem_Adapter $adapter */
     $method = CMTest_TH::getProtectedMethod('CM_File_Filesystem_Adapter', '_getRelativePath');
     $method->invoke($adapter, '/base/base2/../foo');
 }
开发者ID:cargomedia,项目名称:cm,代码行数:11,代码来源:AdapterTest.php


示例2: testProcessTranslationsEnableKey

 public function testProcessTranslationsEnableKey()
 {
     $language = CMTest_TH::createLanguage('test');
     $languageKey = CM_Model_LanguageKey::create('Hello World');
     $this->assertSame(false, $languageKey->getJavascript());
     $site = CM_Site_Abstract::factory();
     $render = new CM_Frontend_Render(new CM_Frontend_Environment(null, null, $language));
     // Check that key is *not* included in the JS translations list
     $versionJavascript = CM_Model_Language::getVersionJavascript();
     $request = new CM_Http_Request_Get($render->getUrlResource('library-js', "translations/{$versionJavascript}.js"));
     $response = CM_Http_Response_Resource_Javascript_Library::createFromRequest($request, $site, $this->getServiceManager());
     $response->process();
     $this->assertNotContains('Hello World', $response->getContent());
     // Request JS-enabling of language key via RPC call
     $body = CM_Params::jsonEncode(['method' => 'CM_Model_Language.requestTranslationJs', 'params' => ['Hello World']]);
     $request = new CM_Http_Request_Post('/rpc', null, null, $body);
     $response = CM_Http_Response_RPC::createFromRequest($request, $site, $this->getServiceManager());
     $response->process();
     CMTest_TH::reinstantiateModel($languageKey);
     $this->assertSame(true, $languageKey->getJavascript());
     // Check that key *is* included in the JS translations list
     $versionJavascript = CM_Model_Language::getVersionJavascript();
     $request = new CM_Http_Request_Get($render->getUrlResource('library-js', "translations/{$versionJavascript}.js"));
     $response = CM_Http_Response_Resource_Javascript_Library::createFromRequest($request, $site, $this->getServiceManager());
     $response->process();
     $this->assertContains('Hello World', $response->getContent());
 }
开发者ID:cargomedia,项目名称:cm,代码行数:27,代码来源:LibraryTest.php


示例3: testAdd

 public function testAdd()
 {
     CM_Config::get()->CM_Paging_Ip_Blocked->maxAge = 3 * 86400;
     $ip = '127.0.0.1';
     $ip2 = '127.0.0.2';
     $paging = new CM_Paging_Ip_Blocked();
     $paging->add(ip2long($ip));
     $this->assertEquals(1, $paging->getCount());
     $entry = $paging->getItem(0);
     $this->assertTrue($paging->contains(ip2long($ip)));
     CMTest_TH::timeDaysForward(2);
     $paging->add(ip2long($ip2));
     CM_Cache_Local::getInstance()->flush();
     $paging->_change();
     $this->assertEquals(2, $paging->getCount());
     CMTest_TH::timeDaysForward(2);
     CM_Paging_Ip_Blocked::deleteOld();
     CM_Cache_Local::getInstance()->flush();
     $paging->_change();
     $this->assertEquals(1, $paging->getCount());
     CMTest_TH::timeDaysForward(2);
     CM_Paging_Ip_Blocked::deleteOld();
     CM_Cache_Local::getInstance()->flush();
     $this->assertEquals(1, $paging->getCount());
     $paging->_change();
     $this->assertEquals(0, $paging->getCount());
 }
开发者ID:cargomedia,项目名称:cm,代码行数:27,代码来源:BlockedTest.php


示例4: testRender

 public function testRender()
 {
     $time = strtotime('2003-02-01 12:34');
     foreach ([['params' => ['time' => $time], 'expected' => '2/1/03'], ['params' => ['time' => $time, 'showTime' => true], 'expected' => CMTest_TH::getVersionICU() < 50 ? '2/1/03 12:34 PM' : '2/1/03, 12:34 PM'], ['params' => ['time' => $time, 'showTime' => true, 'timeZone' => new DateTimeZone('US/Eastern')], 'expected' => CMTest_TH::getVersionICU() < 50 ? '2/1/03 7:34 AM' : '2/1/03, 7:34 AM'], ['params' => ['time' => $time, 'showTime' => true, 'timeZone' => 'US/Eastern'], 'expected' => CMTest_TH::getVersionICU() < 50 ? '2/1/03 7:34 AM' : '2/1/03, 7:34 AM'], ['params' => ['time' => $time, 'showWeekday' => true], 'expected' => 'Sat 2/1/03']] as $testData) {
         $this->_assertSame($testData['expected'], $testData['params']);
     }
 }
开发者ID:cargomedia,项目名称:cm,代码行数:7,代码来源:function.dateTest.php


示例5: testSetValueByEnvironment

 public function testSetValueByEnvironment()
 {
     $location = CMTest_TH::createLocation();
     $locationCity = $location->get(CM_Model_Location::LEVEL_CITY);
     $environment = new CM_Frontend_Environment();
     $environment->setLocation(null);
     $field = new CM_FormField_Location();
     $field->setValueByEnvironment($environment);
     $this->assertNull($field->getValue());
     $environment->setLocation($location->get(CM_Model_Location::LEVEL_COUNTRY));
     $field = new CM_FormField_Location(['levelMin' => CM_Model_Location::LEVEL_CITY]);
     $field->setValueByEnvironment($environment);
     $this->assertNull($field->getValue());
     $environment->setLocation($location);
     $field = new CM_FormField_Location(['levelMin' => CM_Model_Location::LEVEL_CITY, 'levelMax' => CM_Model_Location::LEVEL_CITY]);
     $field->setValueByEnvironment($environment);
     $value = $field->getValue();
     /** @var CM_Model_Location $locationValue */
     $locationValue = $value[0];
     $this->assertSame($locationCity->getId(), $locationValue->getId());
     $this->assertSame($locationCity->getLevel(), $locationValue->getLevel());
     $environment->setLocation($locationCity);
     $field = new CM_FormField_Location(['levelMin' => CM_Model_Location::LEVEL_CITY, 'levelMax' => CM_Model_Location::LEVEL_CITY]);
     $field->setValueByEnvironment($environment);
     $value = $field->getValue();
     /** @var CM_Model_Location $locationValue */
     $locationValue = $value[0];
     $this->assertSame($locationCity->getId(), $locationValue->getId());
     $this->assertSame($locationCity->getLevel(), $locationValue->getLevel());
 }
开发者ID:cargomedia,项目名称:cm,代码行数:30,代码来源:LocationTest.php


示例6: testCheckStreams

 public function testCheckStreams()
 {
     $mockAdapter = $this->getMockForAbstractClass('CM_Stream_Adapter_Video_Abstract', array(), 'CM_Stream_Adapter_Video_Mock', true, true, true, array('_stopStream', 'getType'));
     $mockAdapter->expects($this->exactly(2))->method('_stopStream')->will($this->returnValue(1));
     $mockAdapter->expects($this->any())->method('getType')->will($this->returnValue(1));
     CM_Config::get()->CM_Model_StreamChannel_Abstract->types[CM_Model_StreamChannel_Video_Mock::getTypeStatic()] = 'CM_Model_StreamChannel_Video_Mock';
     $wowza = $wowza = $this->getMock('CM_Stream_Video', array('getAdapter'));
     $wowza->expects($this->any())->method('getAdapter')->will($this->returnValue($mockAdapter));
     /** @var $wowza CM_Stream_Video */
     // allowedUntil will be updated, if stream has expired and its user isn't $userUnchanged, hardcoded in CM_Model_StreamChannel_Video_Mock::canSubscribe() using getOnline()
     $userUnchanged = CMTest_TH::createUser();
     $userUnchanged->setOnline();
     $streamChannel = CM_Model_StreamChannel_Video_Mock::createStatic(array('key' => 'foo1', 'serverId' => 1, 'adapterType' => 1, 'width' => 100, 'height' => 100, 'thumbnailCount' => 0));
     $streamSubscribeUnchanged1 = CM_Model_Stream_Subscribe::createStatic(array('streamChannel' => $streamChannel, 'user' => $userUnchanged, 'key' => 'foo1_2', 'start' => time()));
     $streamSubscribeUnchanged2 = CM_Model_Stream_Subscribe::createStatic(array('streamChannel' => $streamChannel, 'user' => CMTest_TH::createUser(), 'key' => 'foo1_4', 'start' => time()));
     $streamSubscribeChanged1 = CM_Model_Stream_Subscribe::createStatic(array('streamChannel' => $streamChannel, 'user' => CMTest_TH::createUser(), 'key' => 'foo1_3', 'start' => time()));
     $streamPublishUnchanged1 = CM_Model_Stream_Publish::createStatic(array('streamChannel' => $streamChannel, 'user' => $userUnchanged, 'key' => 'foo1_2', 'start' => time()));
     $streamPublishChanged1 = CM_Model_Stream_Publish::createStatic(array('streamChannel' => CM_Model_StreamChannel_Video_Mock::createStatic(array('key' => 'foo2', 'serverId' => 1, 'adapterType' => 1, 'width' => 100, 'height' => 100, 'thumbnailCount' => 0)), 'user' => CMTest_TH::createUser(), 'key' => 'foo2_1', 'start' => time()));
     $this->assertSameTime($streamSubscribeUnchanged1->getAllowedUntil(), time() + 10);
     $this->assertSameTime($streamSubscribeUnchanged2->getAllowedUntil(), time() + 100);
     $this->assertSameTime($streamSubscribeChanged1->getAllowedUntil(), time() + 100);
     $this->assertSameTime($streamPublishUnchanged1->getAllowedUntil(), time() + 10);
     $this->assertSameTime($streamPublishChanged1->getAllowedUntil(), time() + 100);
     CMTest_TH::timeForward(200);
     $wowza->checkStreams();
     $this->assertEquals($streamSubscribeUnchanged1->getAllowedUntil() + 10, $streamSubscribeUnchanged1->_change()->getAllowedUntil());
     $this->assertEquals($streamSubscribeUnchanged2->getAllowedUntil() + 100, $streamSubscribeUnchanged2->_change()->getAllowedUntil());
     $this->assertEquals($streamSubscribeChanged1->getAllowedUntil() + 100, $streamSubscribeChanged1->_change()->getAllowedUntil());
     $this->assertEquals($streamPublishUnchanged1->getAllowedUntil() + 10, $streamPublishUnchanged1->_change()->getAllowedUntil());
     $this->assertEquals($streamPublishChanged1->getAllowedUntil() + 100, $streamPublishChanged1->_change()->getAllowedUntil());
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:31,代码来源:VideoTest.php


示例7: testGetRecordContext

 public function testGetRecordContext()
 {
     $user = CMTest_TH::createUser();
     $httpRequest = CM_Http_Request_Abstract::factory('post', '/foo?bar=1&baz=quux&viewInfoList=fooBar', ['bar' => 'baz', 'host' => 'foo.bar:8080'], ['http_referer' => 'http://bar/baz', 'http_user_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_10)', 'foo' => 'quux'], '{"foo" : "bar", "quux" : "baz"}');
     $clientId = $httpRequest->getClientId();
     $computerInfo = new CM_Log_Context_ComputerInfo('www.example.com', 'v7.0.1');
     $exception = new CM_Exception_Invalid('Bad', null, ['foo' => 'bar']);
     $context = new CM_Log_Context();
     $context->setExtra(['bar' => 'baz', 'baz' => 'quux']);
     $context->setUser($user);
     $context->setException($exception);
     $context->setComputerInfo($computerInfo);
     $context->setHttpRequest($httpRequest);
     $contextFormatter = new CM_Log_ContextFormatter_Cargomedia('appName');
     $formattedContext = $contextFormatter->formatContext($context);
     $this->assertSame('www.example.com', $formattedContext['computerInfo']['fqdn']);
     $this->assertSame('v7.0.1', $formattedContext['computerInfo']['phpVersion']);
     $this->assertSame('/foo?bar=1&baz=quux&viewInfoList=fooBar', $formattedContext['httpRequest']['uri']);
     $this->assertSame(join("\n", ['{', '    "bar": "1",', '    "baz": "quux",', '    "foo": "bar",', '    "quux": "baz"', '}']), $formattedContext['httpRequest']['query']);
     $this->assertSame('POST', $formattedContext['httpRequest']['method']);
     $this->assertSame('http://bar/baz', $formattedContext['httpRequest']['referer']);
     $this->assertSame('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_10)', $formattedContext['httpRequest']['useragent']);
     $this->assertSame('foo.bar', $formattedContext['httpRequest']['hostname']);
     $this->assertSame(['id' => $user->getId(), 'displayName' => 'user' . $user->getId()], $formattedContext['appName']['user']);
     $this->assertSame($clientId, $formattedContext['appName']['client']['id']);
     $this->assertSame('baz', $formattedContext['appName']['bar']);
     $this->assertSame('quux', $formattedContext['appName']['baz']);
     $this->assertSame('CM_Exception_Invalid', $formattedContext['exception']['type']);
     $this->assertSame('Bad', $formattedContext['exception']['message']);
     $this->assertArrayHasKey('stack', $formattedContext['exception']);
     $this->assertInternalType('string', $formattedContext['exception']['stack']);
     $this->assertSame(['foo' => "'bar'"], $formattedContext['exception']['metaInfo']);
     $this->assertRegExp('/library\\/CM\\/Log\\/ContextFormatter\\/CargomediaTest\\.php\\(\\d+\\)/', $formattedContext['exception']['stack']);
 }
开发者ID:cargomedia,项目名称:cm,代码行数:34,代码来源:CargomediaTest.php


示例8: testAggregate

 public function testAggregate()
 {
     $paging = $this->getMockBuilder('CM_Paging_Log_Abstract')->disableOriginalConstructor()->setMethods(array('getType'))->getMockForAbstractClass();
     $paging->expects($this->any())->method('getType')->will($this->returnValue(1));
     /** @var CM_Paging_Log_Abstract $paging */
     $paging->__construct();
     CMTest_TH::callProtectedMethod($paging, '_add', ['haha']);
     CMTest_TH::callProtectedMethod($paging, '_add', ['huhu']);
     CMTest_TH::timeDaysForward(1);
     CMTest_TH::timeDaysForward(1);
     CMTest_TH::callProtectedMethod($paging, '_add', ['haha']);
     CMTest_TH::callProtectedMethod($paging, '_add', ['haha', array('id' => 123123, 'ip' => 1234123)]);
     CMTest_TH::timeDaysForward(1);
     CMTest_TH::callProtectedMethod($paging, '_add', ['ha']);
     CMTest_TH::callProtectedMethod($paging, '_add', ['ha']);
     CMTest_TH::callProtectedMethod($paging, '_add', ['ha']);
     $paging->__construct(true, 2 * 86400);
     $this->assertEquals(2, $paging->getCount());
     $warning1 = $paging->getItem(0);
     $warning2 = $paging->getItem(1);
     $this->assertEquals(3, $warning1['count']);
     $this->assertEquals(2, $warning2['count']);
     $this->assertEquals('haha', $warning2['msg']);
     $this->assertEquals('ha', $warning1['msg']);
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:25,代码来源:AbstractTest.php


示例9: testGetLabel_typeNotConfigured

 public function testGetLabel_typeNotConfigured()
 {
     $actor = CMTest_TH::createUser();
     $typeEmail = mt_rand();
     $action = new CM_Action_Email(CM_Action_Abstract::VIEW, $actor, $typeEmail);
     $this->assertSame('Email View ' . $typeEmail, $action->getLabel());
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:7,代码来源:EmailTest.php


示例10: testFindByMediaId

 public function testFindByMediaId()
 {
     $this->assertNull(CM_Model_StreamChannelArchive_Media::findByMediaId('foo'));
     /** @var CM_Model_StreamChannel_Media $streamChannel */
     $streamChannel = $streamChannel = CMTest_TH::createStreamChannel(null, null, 'foo');
     $this->assertEquals($streamChannel, CM_Model_StreamChannel_Media::findByMediaId($streamChannel->getMediaId()));
 }
开发者ID:cargomedia,项目名称:cm,代码行数:7,代码来源:MediaTest.php


示例11: testTrackPageView

    public function testTrackPageView()
    {
        $viewer = CMTest_TH::createUser();
        $environment = new CM_Frontend_Environment(CM_Site_Abstract::factory(), $viewer);
        $client = new CMService_AdWords_Client();
        $pushConversion = new ReflectionMethod($client, '_pushConversion');
        $pushConversion->setAccessible(true);
        $pushConversion->invoke($client, $viewer, CMService_AdWords_Conversion::fromJson('{"google_conversion_id":123456,"google_conversion_language":"en","google_conversion_format":"1","google_conversion_color":"666666","google_conversion_label":"label","google_remarketing_only":true,"google_conversion_value":123,"google_conversion_currency":"USD","google_custom_params":{"a":1,"b":2}}'));
        $pushConversion->invoke($client, $viewer, CMService_AdWords_Conversion::fromJson('{"google_conversion_id":789}'));
        $this->assertSame('', $client->getJs());
        $this->assertSame(<<<EOD
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion_async.js" charset="utf-8"></script>
EOD
, $client->getHtml($environment));
        $client->trackPageView($environment, '/');
        $this->assertSame(<<<EOD
window.google_trackConversion({"google_conversion_id":123456,"google_conversion_language":"en","google_conversion_format":"1","google_conversion_color":"666666","google_conversion_label":"label","google_remarketing_only":true,"google_conversion_value":123,"google_conversion_currency":"USD","google_custom_params":{"a":1,"b":2}});window.google_trackConversion({"google_conversion_id":789});
EOD
, $client->getJs());
        $this->assertSame(<<<EOD
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion_async.js" charset="utf-8"></script><script type="text/javascript">
/* <![CDATA[ */
window.google_trackConversion({"google_conversion_id":123456,"google_conversion_language":"en","google_conversion_format":"1","google_conversion_color":"666666","google_conversion_label":"label","google_remarketing_only":true,"google_conversion_value":123,"google_conversion_currency":"USD","google_custom_params":{"a":1,"b":2}});window.google_trackConversion({"google_conversion_id":789});
//]]>
</script>
EOD
, $client->getHtml($environment));
    }
开发者ID:cargomedia,项目名称:cm,代码行数:28,代码来源:ClientTest.php


示例12: setUp

 public function setUp()
 {
     $smarty = new Smarty();
     $this->_render = new CM_Frontend_Render();
     $this->_template = $smarty->createTemplate('string:');
     $this->_template->assignGlobal('render', $this->_render);
     $this->_location = CMTest_TH::createLocation();
 }
开发者ID:cargomedia,项目名称:cm,代码行数:8,代码来源:function.locationTest.php


示例13: test_Get

 public function test_Get()
 {
     $user = CMTest_TH::createUser();
     $user->getRoles()->add(self::ROLE_A, 2000);
     $stamps = CM_Db_Db::select('cm_role', array('startStamp', 'expirationStamp'), array('userId' => $user->getId()))->fetch();
     $this->assertEquals($stamps['startStamp'], $user->getRoles()->getStartStamp(self::ROLE_A));
     $this->assertEquals($stamps['expirationStamp'], $user->getRoles()->getExpirationStamp(self::ROLE_A));
 }
开发者ID:cargomedia,项目名称:cm,代码行数:8,代码来源:RolesTest.php


示例14: test_encodeRecord

 public function test_encodeRecord()
 {
     /** @var CM_Log_Handler_Fluentd|\Mocka\AbstractClassTrait $mock */
     $mock = $this->mockClass('CM_Log_Handler_Fluentd')->newInstanceWithoutConstructor();
     $this->assertSame([], CMTest_TH::callProtectedMethod($mock, '_encodeRecord', [[]]));
     $record = ['foo' => ['id' => 123, 'bar' => (object) ['baz'], 'baz' => new DateTime('01-01-2001'), 'bax' => new CM_Model_Mock_Fluentd()]];
     $this->assertSame(['foo' => ['id' => '123', 'bar' => ['class' => 'stdClass'], 'baz' => '2001-01-01T00:00:00+00:00', 'bax' => ['class' => 'CM_Model_Mock_Fluentd', 'id' => '42']]], CMTest_TH::callProtectedMethod($mock, '_encodeRecord', [$record]));
 }
开发者ID:cargomedia,项目名称:cm,代码行数:8,代码来源:FluentdTest.php


示例15: bootstrap

 public function bootstrap()
 {
     $this->generateInternalConfig();
     CMTest_TH::init();
     $comparatorFactory = SebastianBergmann\Comparator\Factory::getInstance();
     $comparatorFactory->register(new CMTest_Comparator_Comparable());
     $comparatorFactory->register(new CMTest_Comparator_BetterArrayComparator());
 }
开发者ID:cargomedia,项目名称:cm,代码行数:8,代码来源:TestSuite.php


示例16: testGetCacheKey

 public function testGetCacheKey()
 {
     CM_Config::get()->CM_Model_Abstract = new stdClass();
     CM_Config::get()->CM_Model_Abstract->types = array(1 => 'CMTest_ModelMock_1', 2 => 'CMTest_ModelMock_2');
     $adapter = new CM_Model_StorageAdapter_Cache();
     $method = CMTest_TH::getProtectedMethod('CM_Model_StorageAdapter_Cache', '_getCacheKey');
     $this->assertSame('CM_Model_StorageAdapter_Cache_type:1_id:a:1:{s:2:"id";i:2;}', $method->invoke($adapter, 1, array('id' => 2)));
     $this->assertSame('CM_Model_StorageAdapter_Cache_type:2_id:a:1:{s:2:"id";i:3;}', $method->invoke($adapter, 2, array('id' => 3)));
 }
开发者ID:cargomedia,项目名称:cm,代码行数:9,代码来源:CacheTest.php


示例17: testGetTableName

 public function testGetTableName()
 {
     CM_Config::get()->CM_Model_Abstract = new stdClass();
     CM_Config::get()->CM_Model_Abstract->types = array(1 => 'CMTest_ModelMock_1', 2 => 'CMTest_ModelMock_2');
     $adapter = new CM_Model_StorageAdapter_Database();
     $method = CMTest_TH::getProtectedMethod('CM_Model_StorageAdapter_Database', '_getTableName');
     $this->assertSame('cmtest_modelmock_1', $method->invoke($adapter, 1));
     $this->assertSame('custom_table', $method->invoke($adapter, 2));
 }
开发者ID:aladin1394,项目名称:CM,代码行数:9,代码来源:DatabaseTest.php


示例18: testInvalidatedModel

 public function testInvalidatedModel()
 {
     CM_ModelAsset_User_Preferences::setDefault('test', 'foo', false, true);
     CM_ModelAsset_User_Preferences::setDefault('test', 'bar', true, true);
     $user = CMTest_TH::createUser();
     $user->_change();
     $user->getPreferences()->getAll();
     $user->getLatestActivity();
 }
开发者ID:cargomedia,项目名称:cm,代码行数:9,代码来源:PreferencesTest.php


示例19: testDeleteOlder

 public function testDeleteOlder()
 {
     $file = CM_File_UserContent_Temp::create('foo.txt', 'bar');
     $this->assertTrue($file->exists());
     CM_File_UserContent_Temp::deleteOlder(100);
     $this->assertTrue($file->exists());
     CMTest_TH::timeForward(1000);
     CM_File_UserContent_Temp::deleteOlder(100);
     $this->assertFalse($file->exists());
 }
开发者ID:cargomedia,项目名称:cm,代码行数:10,代码来源:TempTest.php


示例20: testOnSubscribe

 public function testOnSubscribe()
 {
     $user = CMTest_TH::createUser();
     /** @var CM_Model_StreamChannel_Message_User $channel */
     $channel = CM_Model_StreamChannel_Message_User::createStatic(['key' => CM_Model_StreamChannel_Message_User::getKeyByUser($user), 'adapterType' => CM_MessageStream_Adapter_SocketRedis::getTypeStatic()]);
     $this->assertSame(false, $user->getOnline());
     $subscribe = CMTest_TH::createStreamSubscribe($user, $channel);
     CMTest_TH::reinstantiateModel($user);
     $this->assertSame(true, $user->getOnline());
 }
开发者ID:cargomedia,项目名称:cm,代码行数:10,代码来源:UserTest.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CM_Db_Db类代码示例发布时间:2022-05-23
下一篇:
PHP CMS_view类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap