コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function has($path)
 {
     return $this->client->itemExists($path);
 }
コード例 #2
0
 public function testItemExistsWhenItDoesntExist()
 {
     $client = $this->getMockBuilder('\\GuzzleHttp\\Client')->getMock();
     $accessToken = '123456789';
     $exception = new ClientException('Not found', new Request('GET', 'uri'), new Response(404));
     $client->expects($this->once())->method('send')->willThrowException($exception);
     $oneDriveClient = new OneDriveClient($accessToken, $client);
     $result = $oneDriveClient->itemExists('some file.txt');
     $this->assertSame(false, $result);
 }