Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Ignore whitespace Rev 1048 → Rev 1049

/tags/v5.7-arrayanal/services/tests/0.1/bdtfx/BdtfxLMetaTest.php
New file
0,0 → 1,44
<?php
require_once __DIR__.'/../ServiceEflorePhpUnit.php';
 
class BdtfxMetaTest extends ServiceEflorePhpUnit {
 
public function testVersions() {
 
// version fixe: version.projet=1.01
 
$url = ServiceEflorePhpUnit::creerUrl('meta-donnees', [], ['version.projet' => '1.01']);
$retour = $this->consulterJson('meta-donnees', 'bdtfx', [], ['version.projet' => '1.01']);
$this->assertArrayHasKey(00, $retour, "json error, pas d'élément 0, $url");
$retour = $retour[0];
 
$this->assertArrayHasKey('guid', $retour, "json error, $url");
$this->assertArrayHasKey('code', $retour, "json error, $url");
$this->assertArrayHasKey('version', $retour, "json error, $url");
$this->assertArrayHasKey('titre', $retour, "json error, $url");
$this->assertArrayHasKey('contributeurs', $retour, "json error, $url");
// TODO: autres
 
$this->assertArrayHasKey('contributeurs', $retour, "json error, $url");
$this->assertEquals('1.01', $retour['version'], "json attribute error \"version\", $url");
 
// dernière version: version.projet=+
 
$url = ServiceEflorePhpUnit::creerUrl('meta-donnees', [], ['version.projet' => '+']);
$retour = $this->consulterJson('meta-donnees', 'bdtfx', [], ['version.projet' => '+']);
$this->assertArrayHasKey(00, $retour, "json error, pas d'élément 0, $url");
$retour = $retour[0];
 
$this->assertArrayHasKey('guid', $retour, "json error, $url");
$this->assertArrayHasKey('code', $retour, "json error, $url");
$this->assertArrayHasKey('version', $retour, "json error, $url");
$this->assertArrayHasKey('titre', $retour, "json error, $url");
$this->assertArrayHasKey('contributeurs', $retour, "json error, $url");
// TODO: autres
 
$this->assertArrayHasKey('contributeurs', $retour, "json error, $url");
// 2013/09/23
$this->assertEquals('2.00', $retour['version'], "json attribute error \"version\", $url");
}
}
?>