public function exists() { try { $this->connection->getObject($this->identity + ['fields' => 'name']); } catch (NotFoundException $ex) { return false; } return true; }
public function testDoesExistFalse() { $this->connection->getObject(Argument::any())->willThrow(new NotFoundException(null)); $object = new StorageObject($this->connection->reveal(), 'object.txt', 'bucket'); $this->assertFalse($object->exists()); }