當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。