public function testParseInvalid404() { $response = new ResponseCore(array(), "", 404); $result = new ExistResult($response); $this->assertTrue($result->isOK()); $this->assertEquals($result->getData(), false); }
/** * 检测Object是否存在 * 通过获取Object的Meta信息来判断Object是否存在, 用户需要自行解析ResponseCore判断object是否存在 * * @param string $bucket bucket名称 * @param string $object object名称 * @param array $options * * @return bool */ public function doesObjectExist($bucket, $object, $options = null) { $this->precheckCommon($bucket, $object, $options); $options[self::OSS_BUCKET] = $bucket; $options[self::OSS_METHOD] = self::OSS_HTTP_HEAD; $options[self::OSS_OBJECT] = $object; $response = $this->auth($options); $result = new ExistResult($response); return $result->getData(); }