本文整理匯總了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());
}
示例2: testClear
public function testClear()
{
Session::shouldReceive('forget')->once()->with($this->prefix . 'code')->andReturn(true);
$this->storage->clear('code');
}
示例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);
}