diff --git a/lib/unitTest/Alchemy/Phrasea/Application/ApiJsonTest.php b/lib/unitTest/Alchemy/Phrasea/Application/ApiJsonTest.php index 3402d4cc0c..f541cfc98f 100644 --- a/lib/unitTest/Alchemy/Phrasea/Application/ApiJsonTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Application/ApiJsonTest.php @@ -1011,7 +1011,7 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract $this->assertObjectHasAttribute('response', $content); $this->assertTrue(is_object($content->meta), 'Le bloc meta est un objet json'); $this->assertTrue(is_object($content->response), 'Le bloc reponse est un objet json'); - $this->assertEquals('1.0', $content->meta->api_version); + $this->assertEquals('1.1', $content->meta->api_version); $this->assertNotNull($content->meta->response_time); $this->assertEquals('UTF-8', $content->meta->charset); } diff --git a/lib/unitTest/Alchemy/Phrasea/Application/ApiYamlTest.php b/lib/unitTest/Alchemy/Phrasea/Application/ApiYamlTest.php index bf3d856b07..f96ae8b44a 100644 --- a/lib/unitTest/Alchemy/Phrasea/Application/ApiYamlTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Application/ApiYamlTest.php @@ -1032,7 +1032,7 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract $this->assertArrayHasKey('response', $content); $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $content["meta"], 'La response est un array'); $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $content["response"], 'La response est un objet'); - $this->assertEquals('1.0', $content["meta"]["api_version"]); + $this->assertEquals('1.1', $content["meta"]["api_version"]); $this->assertNotNull($content["meta"]["response_time"]); $this->assertEquals('UTF-8', $content["meta"]["charset"]); } @@ -1044,7 +1044,7 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract $this->assertArrayHasKey('response', $content); $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $content["meta"], 'La response est un array'); $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $content["response"], 'La response est un array'); - $this->assertEquals('1.0', $content["meta"]["api_version"]); + $this->assertEquals('1.1', $content["meta"]["api_version"]); $this->assertNotNull($content["meta"]["response_time"]); $this->assertEquals('UTF-8', $content["meta"]["charset"]); } diff --git a/lib/unitTest/api/v1/api_v1_adapterTest.php b/lib/unitTest/api/v1/api_v1_adapterTest.php index 6af633727d..e04159fd35 100644 --- a/lib/unitTest/api/v1/api_v1_adapterTest.php +++ b/lib/unitTest/api/v1/api_v1_adapterTest.php @@ -95,7 +95,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testGet_version() { - $this->assertEquals('1.0', $this->object->get_version()); + $this->assertEquals('1.1', $this->object->get_version()); } public function testGet_databoxes() @@ -264,19 +264,18 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract $metadatas[] = array( 'meta_id' => $meta_id , 'meta_struct_id' => $field->get_id() - , 'value' => 'podom pom pom ' . $field->get_id() + , 'value' => 'poOM POOM TCHOK ' . $field->get_id() ); } - $metadatas = array_shift($metadatas); - $metadatas["value"] = "new_value"; - - $request = new Request(array("metadatas" => array($metadatas)), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json')); + $request = new Request(array("metadatas" => $metadatas), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json')); $result = $this->object->set_record_metadatas($request, self::$record_1->get_sbas_id(), self::$record_1->get_record_id()); $response = json_decode($result->format()); + $this->assertEquals($response->meta->http_code, 200); + $this->checkResponseField($result, "metadatas", PHPUnit_Framework_Constraint_IsType::TYPE_OBJECT); }