/** * {@inheritdoc} */ public function has($path) { return $this->client->itemExists($path); }
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); }