本文整理汇总了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);
}