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


PHP Session::shouldReceive方法代码示例

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


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

示例1: testSendAction

 public function testSendAction()
 {
     Session::shouldReceive('getId')->once()->andReturn(self::SESSION_ID);
     $this->easyrec->sendAction(self::ITEM_ID, self::ITEM_DESCRIPTION, self::ITEM_URL, self::CUSTOM_ACTION);
     // Test required keys
     $requiredKeys = ['itemid', 'itemdescription', 'itemurl', 'actiontype', 'sessionid'];
     $queryParams = $this->easyrec->getQueryParams();
     foreach ($requiredKeys as $key) {
         $this->assertArrayHasKey($key, $queryParams);
     }
     // Test values in the request
     $this->assertEquals($queryParams["apikey"], "mock-key");
     $this->assertEquals($queryParams["tenantid"], "mock-tenant");
     $this->assertEquals($queryParams["sessionid"], self::SESSION_ID);
     $this->assertEquals($queryParams["itemid"], self::ITEM_ID);
     $this->assertEquals($queryParams["itemdescription"], self::ITEM_DESCRIPTION);
     $this->assertEquals($queryParams["itemurl"], self::ITEM_URL);
     $this->assertEquals($queryParams["actiontype"], self::CUSTOM_ACTION);
     // Test the endpoint name
     $this->assertEquals('sendaction', $this->easyrec->getEndpoint());
 }
开发者ID:antoineaugusti,项目名称:laravel-easyrec,代码行数:21,代码来源:EasyrecTestActions.php

示例2: testClear

 public function testClear()
 {
     Session::shouldReceive('forget')->once()->with($this->prefix . 'code')->andReturn(true);
     $this->storage->clear('code');
 }
开发者ID:mauri870,项目名称:LinkedIn-API-client,代码行数:5,代码来源:IlluminateSessionStorageTest.php

示例3: test_allowed_extensions_to_json

 public function test_allowed_extensions_to_json()
 {
     Session::shouldReceive('get')->once()->with('formFields')->andReturn(array('media' => array('type' => 'media', 'allowed' => Browser::TYPE_AUDIO)));
     $json = $this->browser->allowedExtensionsToJSON('media');
     $this->assertEquals('["mp3","wav"]', $json);
 }
开发者ID:spescina,项目名称:mediabrowser,代码行数:6,代码来源:BrowserTest.php


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