public function testRename() { $mock = $this->getS3Client(); $this->expectVisibilityCall(Permission::READ, 'old', $mock); $mock->shouldReceive('headObject')->once()->andReturn(Mockery::self()); $mock->shouldReceive('getAll')->once()->andReturn(['ContentLength' => 20, 'ContentType' => 'text/plain', 'StorageClass' => StorageClass::STANDARD]); $mock->shouldReceive('copyObject')->once()->andReturn(Mockery::self()); $response = Mockery::mock('Guzzle\\Service\\Resource\\Model'); $mock->shouldReceive('deleteObject')->once()->andReturn($response); $mock->shouldReceive('doesObjectExist')->once()->andReturn(true); $adapter = new Adapter($mock, 'bucketname'); $result = $adapter->rename('old', 'new'); $this->assertTrue($result); }
public function testRename() { $mock = $this->getS3Client(); $this->expectVisibilityCall(Permission::READ, 'old', $mock); $mock->shouldReceive('copyObject')->once()->andReturn(Mockery::self()); $response = Mockery::mock('Guzzle\\Service\\Resource\\Model'); $mock->shouldReceive('deleteObject')->once()->andReturn($response); $mock->shouldReceive('doesObjectExist')->once()->andReturn(true); $adapter = new Adapter($mock, 'bucketname'); $result = $adapter->rename('old', 'new'); $this->assertTrue($result); }