900 |
raphael |
1 |
<?php
|
|
|
2 |
require_once __DIR__.'/../ServiceEflorePhpUnit.php';
|
|
|
3 |
|
|
|
4 |
class BdtfxMetaTest extends ServiceEflorePhpUnit {
|
|
|
5 |
|
|
|
6 |
public function testVersions() {
|
|
|
7 |
|
|
|
8 |
// version fixe: version.projet=1.01
|
|
|
9 |
|
|
|
10 |
$url = ServiceEflorePhpUnit::creerUrl('meta-donnees', [], ['version.projet' => '1.01']);
|
|
|
11 |
$retour = $this->consulterJson('meta-donnees', 'bdtfx', [], ['version.projet' => '1.01']);
|
|
|
12 |
$this->assertArrayHasKey(00, $retour, "json error, pas d'élément 0, $url");
|
|
|
13 |
$retour = $retour[0];
|
|
|
14 |
|
|
|
15 |
$this->assertArrayHasKey('guid', $retour, "json error, $url");
|
|
|
16 |
$this->assertArrayHasKey('code', $retour, "json error, $url");
|
|
|
17 |
$this->assertArrayHasKey('version', $retour, "json error, $url");
|
|
|
18 |
$this->assertArrayHasKey('titre', $retour, "json error, $url");
|
|
|
19 |
$this->assertArrayHasKey('contributeurs', $retour, "json error, $url");
|
|
|
20 |
// TODO: autres
|
|
|
21 |
|
|
|
22 |
$this->assertArrayHasKey('contributeurs', $retour, "json error, $url");
|
|
|
23 |
$this->assertEquals('1.01', $retour['version'], "json attribute error \"version\", $url");
|
|
|
24 |
|
|
|
25 |
// dernière version: version.projet=+
|
|
|
26 |
|
|
|
27 |
$url = ServiceEflorePhpUnit::creerUrl('meta-donnees', [], ['version.projet' => '+']);
|
|
|
28 |
$retour = $this->consulterJson('meta-donnees', 'bdtfx', [], ['version.projet' => '+']);
|
|
|
29 |
$this->assertArrayHasKey(00, $retour, "json error, pas d'élément 0, $url");
|
|
|
30 |
$retour = $retour[0];
|
|
|
31 |
|
|
|
32 |
$this->assertArrayHasKey('guid', $retour, "json error, $url");
|
|
|
33 |
$this->assertArrayHasKey('code', $retour, "json error, $url");
|
|
|
34 |
$this->assertArrayHasKey('version', $retour, "json error, $url");
|
|
|
35 |
$this->assertArrayHasKey('titre', $retour, "json error, $url");
|
|
|
36 |
$this->assertArrayHasKey('contributeurs', $retour, "json error, $url");
|
|
|
37 |
// TODO: autres
|
|
|
38 |
|
|
|
39 |
$this->assertArrayHasKey('contributeurs', $retour, "json error, $url");
|
|
|
40 |
// 2013/09/23
|
|
|
41 |
$this->assertEquals('2.00', $retour['version'], "json attribute error \"version\", $url");
|
|
|
42 |
}
|
|
|
43 |
}
|
|
|
44 |
?>
|