Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 205 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 205 Rev 1142
Line 1... Line 1...
1
<?php
1
<?php
Line 2... Line 2...
2
 
2
 
3
class ResultatFormateurInitialisation extends PHPUnit_Framework_TestCase {
-
 
4
	const TPL_URL_FICHE = 'http://localhost/eflore/eflore-consultation/index_botanique.php?referentiel=bdtfx&module=fiche&action=fiche&nn=%s';
-
 
5
	const TPL_URL_BASE_DOSSIER = 'http://localhost/eflore-consultation/';
3
class ResultatFormateurInitialisation extends PHPUnit_Framework_TestCase {
6
	
4
 
7
	public static function setUpBeforeClass() {
5
	public static function setUpBeforeClass() {
Line 8... Line 6...
8
		error_reporting(E_ALL);
6
		error_reporting(E_ALL);
9
 
7
 
Line 40... Line 38...
40
		$resultats = json_decode($resultatsJson, true);
38
		$resultats = json_decode($resultatsJson, true);
41
		return $resultats[$masque];
39
		return $resultats[$masque];
42
	}
40
	}
Line 43... Line 41...
43
 
41
 
44
	protected function getSurligneur() {
-
 
45
		$surligneur = new Surligneur();
42
	protected function getSurligneur() {
46
		return $surligneur;
43
		return new Surligneur();
Line 47... Line 44...
47
	}
44
	}
48
 
45
 
49
	protected function getTrieur() {
-
 
50
		$trieur = new Trieur();
46
	protected function getTrieur() {
Line 51... Line 47...
51
		return $trieur;
47
		return new Trieur();
52
	}
48
	}
53
 
49
 
54
	protected function getAppUrls() {
50
	protected function getAppUrls() {
55
		$AppUrls = $this->getMock('AppUrls', array('obtenirUrlFiche', 'obtenirUrlBaseDossier'), array(), '', false);
51
		$AppUrls = $this->getMock('AppUrls', array('obtenirUrlFiche', 'obtenirUrlBaseDossier'), array(), '', false);
56
		$AppUrls->expects($this->any())
52
		$AppUrls->expects($this->any())
57
		->method('obtenirUrlFiche')
53
                ->method('obtenirUrlFiche')
58
		->will($this->returnCallback(array($this, 'genererUrlFiche')));
54
                ->will($this->returnCallback(array($this, 'genererUrlFiche')));
59
		$AppUrls->expects($this->any())
55
		$AppUrls->expects($this->any())
60
		->method('obtenirUrlBaseDossier')
56
                ->method('obtenirUrlBaseDossier')
Line 61... Line 57...
61
		->will($this->returnCallback(array($this, 'genererUrlBaseDossier')));
57
                ->will($this->returnValue(ConsultationEflorePhpUnit::TPL_URL_BASE_DOSSIER));
62
		return $AppUrls;
58
		return $AppUrls;
63
	}
-
 
64
 
-
 
65
	public function genererUrlFiche($id) {
-
 
66
		return sprintf(self::TPL_URL_FICHE, $id);
-
 
67
	}
59
	}
68
	
60
 
69
	public function genererUrlBaseDossier() {
61
	public function genererUrlFiche($id) {
70
		return self::TPL_URL_BASE_DOSSIER;
62
		return sprintf(ConsultationEflorePhpUnit::TPL_URL_FICHE, $id);