-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #243 from mattgu74/fix_semestre
Gestion générique des semestres dans le module stats fix #180
- Loading branch information
Showing
5 changed files
with
93 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
require_once "ServiceBaseRodbTest.php"; | ||
|
||
use \Payutc\Bom\User; | ||
|
||
class StatsRodbTest extends ServiceBaseRodbTest | ||
{ | ||
public function getFixtures() | ||
{ | ||
return array_merge(parent::getFixtures(), array( | ||
'products.yml', 'purchase.yml' | ||
)); | ||
} | ||
|
||
|
||
/* ========== TEST DE GET NB SELL =============================== */ | ||
|
||
/** | ||
* @requires PHP 5.4 | ||
*/ | ||
public function testGetNbSell() | ||
{ | ||
$cookie = ''; | ||
$r = null; | ||
$this->loginCas($cookie, $r, 'mguffroy@POSS3', 'POSS3'); | ||
$this->loginApp($cookie, $r, 'app_stats'); | ||
$r = httpSend('STATS', 'getNbSell', $cookie, array( | ||
'obj_id' => '4', | ||
'fun_id' => '1' | ||
)); | ||
$this->assertEquals(200, $r->code); | ||
$this->assertEquals(8, $r->body); | ||
} | ||
|
||
|
||
/* ========== TEST DE GETRANK =============================== */ | ||
/** | ||
* @requires PHP 5.4 | ||
*/ | ||
public function testGetRank() | ||
{ | ||
$cookie = ''; | ||
$r = null; | ||
$this->loginCas($cookie, $r, 'mguffroy@POSS3', 'POSS3'); | ||
$this->loginApp($cookie, $r, 'app_stats'); | ||
$r = httpSend('STATS', 'getRank', $cookie, array( | ||
'fun_id' => '1', | ||
'semestre' => 'P13' | ||
)); | ||
$this->assertEquals(200, $r->code); | ||
$this->assertEquals(array(array( | ||
'totalPrice' => 630, | ||
'nbBuy' => 9, | ||
'usr_firstname' => 'Matthieu', | ||
'usr_lastname' => 'Guffroy', | ||
'usr_nickname' => 'mguffroy' | ||
)), $r->body); | ||
} | ||
|
||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,7 @@ tj_app_fun_afu: | |
app_id: 1 | ||
fun_id: 1 | ||
afu_service: ADMINRIGHT | ||
- | ||
app_id: 3 | ||
fun_id: 1 | ||
afu_service: STATS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,8 @@ tj_usr_fun_ufu: | |
usr_id: 1 | ||
fun_id: 1 | ||
ufu_service: ADMINRIGHT | ||
- | ||
usr_id: 9447 | ||
fun_id: 1 | ||
ufu_service: STATS | ||
|