本文整理汇总了PHP中Storage::shouldReceive方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::shouldReceive方法的具体用法?PHP Storage::shouldReceive怎么用?PHP Storage::shouldReceive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Storage
的用法示例。
在下文中一共展示了Storage::shouldReceive方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_Should_ReturnFalse_When_RollbackCommandFails
public function test_Should_ReturnFalse_When_RollbackCommandFails()
{
Storage::shouldReceive('put')->once()->andReturn(0);
$deployCommander = new StorageDeployCommander();
$result = $deployCommander->rollback(new App\Models\Deployment());
$this->assertFalse($result, 'Expected rollback command to fail.');
}
示例2: testUpload
public function testUpload()
{
$this->uploadedFileMock->expects($this->any())->method('getClientOriginalName')->willReturn('original_name');
$this->uploadedFileMock->expects($this->once())->method('getRealPath')->willReturn(tempnam('tmp', 'test'));
$this->requestMock->expects($this->once())->method('file')->willReturn($this->uploadedFileMock);
\Storage::shouldReceive('put')->once();
$mediaUploader = new UploadFileWhenAddingMedia($this->requestMock);
$mediaUploader->creating($this->mediaMock);
}
示例3: test_uploads_can_have_an_existing_series_id
/**
* @group basic
* @group upload-test
*/
public function test_uploads_can_have_an_existing_series_id()
{
$this->seed();
Storage::shouldReceive('disk->put');
AWS::shouldReceive('createClient->getCommand');
AWS::shouldReceive('createClient->createPresignedRequest->getUri');
AWS::shouldReceive('createClient->getObjectUrl')->andReturn('value');
AWS::shouldReceive('Lambda');
AWS::shouldReceive('Lambda->invokeAsync');
$series = factory(App\Models\Series::class)->create(['user_id' => 1]);
$file = new Symfony\Component\HttpFoundation\File\UploadedFile(storage_path('test files/test-comic-6-pages.cbz'), 'test-comic-6-pages.cbz', 'application/zip', 1000, null, TRUE);
$req = $this->postWithFile($this->basic_upload_endpoint, ["series_id" => $series->id, "comic_id" => Uuid::uuid4()->toString(), "series_title" => "test", "series_start_year" => "2015", "comic_issue" => 1], ['Authorization' => 'Bearer ' . $this->test_basic_access_token], ['file' => $file]);
$this->assertResponseStatus(201);
}
示例4: testRemoval
public function testRemoval()
{
\Storage::shouldReceive('delete')->once();
$mediaUploader = new RemoveFileWhenDeletingMedia($this->requestMock);
$mediaUploader->deleting($this->mediaMock);
}