public function test_allow_missing()
 {
     Curl::mockUpload($this);
     Uploader::create_zip(array("tags" => $this->tag, "allow_missing" => TRUE));
     assertUrl($this, '/image/generate_archive');
     assertParam($this, "tags[0]", $this->tag);
     assertParam($this, "allow_missing", 1, "should support the 'allow_missing' parameter");
 }
 public function test_tags()
 {
     $api = new \Cloudinary\Api();
     $result = Uploader::upload(self::LOGO_PNG);
     Curl::mockUpload($this);
     Uploader::add_tag("tag1", "foobar");
     assertUrl($this, "/image/tags");
     assertPost($this);
     assertParam($this, "public_ids[0]", "foobar");
     assertParam($this, "command", "add");
     assertParam($this, "tag", "tag1");
     Uploader::remove_tag("tag1", "foobar");
     assertUrl($this, "/image/tags");
     assertPost($this);
     assertParam($this, "public_ids[0]", "foobar");
     assertParam($this, "command", "remove");
     assertParam($this, "tag", "tag1");
     Uploader::replace_tag("tag3", "foobar");
     assertUrl($this, "/image/tags");
     assertPost($this);
     assertParam($this, "public_ids[0]", "foobar");
     assertParam($this, "command", "replace");
     assertParam($this, "tag", "tag3");
 }
Exemple #3
0
 function test_update_parameters()
 {
     Curl::mockApi($this);
     $this->api->update(self::$api_test, array("auto_tagging" => 0.5));
     assertUrl($this, '/resources/image/upload/' . self::$api_test);
     assertParam($this, "auto_tagging", 0.5);
     $fields = Curl::$instance->fields();
     $this->assertArrayNotHasKey("face_coordinates", $fields, "update() should not send empty parameters");
     $this->assertArrayNotHasKey("tags", $fields, "update() should not send empty parameters");
     $this->assertArrayNotHasKey("context", $fields, "update() should not send empty parameters");
     $this->assertArrayNotHasKey("face_coordinates", $fields, "update() should not send empty parameters");
     $this->assertArrayNotHasKey("custom_coordinates", $fields, "update() should not send empty parameters");
 }