当前位置: 首页>>代码示例>>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;未经允许,请勿转载。