當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Storage::shouldReceive方法代碼示例

本文整理匯總了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.');
 }
開發者ID:ngmy,項目名稱:webloyer,代碼行數:7,代碼來源:StorageDeployCommanderTest.php

示例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);
 }
開發者ID:laravel-italia,項目名稱:site,代碼行數:9,代碼來源:UploadFileWhenAddingMediaTest.php

示例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);
 }
開發者ID:kidshenlong,項目名稱:comic-cloud-lumen,代碼行數:18,代碼來源:UploadTest.php

示例4: testRemoval

 public function testRemoval()
 {
     \Storage::shouldReceive('delete')->once();
     $mediaUploader = new RemoveFileWhenDeletingMedia($this->requestMock);
     $mediaUploader->deleting($this->mediaMock);
 }
開發者ID:laravel-italia,項目名稱:site,代碼行數:6,代碼來源:RemoveFileWhenDeletingMediaTest.php


注:本文中的Storage::shouldReceive方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。