update_upload_mapping() public method

public update_upload_mapping ( $name, $options = [] )
 function test35_upload_mapping()
 {
     try {
         $this->api->delete_upload_mapping("api_test_upload_mapping");
     } catch (Exception $e) {
     }
     $this->api->create_upload_mapping("api_test_upload_mapping", array("template" => "http://cloudinary.com"));
     $result = $this->api->upload_mapping("api_test_upload_mapping");
     $this->assertEquals($result["template"], "http://cloudinary.com");
     $this->api->update_upload_mapping("api_test_upload_mapping", array("template" => "http://res.cloudinary.com"));
     $result = $this->api->upload_mapping("api_test_upload_mapping");
     $this->assertEquals($result["template"], "http://res.cloudinary.com");
     $result = $this->api->upload_mappings();
     $this->assertContains(array("folder" => "api_test_upload_mapping", "template" => "http://res.cloudinary.com"), $result["mappings"]);
     $this->api->delete_upload_mapping("api_test_upload_mapping");
     $result = $this->api->upload_mappings();
     $this->assertNotContains("api_test_upload_mapping", $result["mappings"]);
 }
Esempio n. 2
0
 function test35_upload_mapping()
 {
     Curl::mockApi($this);
     $this->api->create_upload_mapping("api_test_upload_mapping", array("template" => "http://cloudinary.com"));
     assertUrl($this, "/upload_mappings");
     assertPost($this);
     assertParam($this, "folder", "api_test_upload_mapping");
     assertParam($this, "template", "http://cloudinary.com");
     $result = $this->api->upload_mapping("api_test_upload_mapping");
     assertUrl($this, "/upload_mappings");
     assertGet($this);
     assertParam($this, "folder", "api_test_upload_mapping");
     $this->api->update_upload_mapping("api_test_upload_mapping", array("template" => "http://res.cloudinary.com"));
     assertUrl($this, "/upload_mappings");
     assertPut($this);
     assertParam($this, "folder", "api_test_upload_mapping");
     assertParam($this, "template", "http://res.cloudinary.com");
     $this->api->delete_upload_mapping("api_test_upload_mapping");
     assertUrl($this, "/upload_mappings");
     assertDelete($this);
     assertParam($this, "folder", "api_test_upload_mapping");
 }