summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Coevoet <stof@notk.org>2012-10-06 15:24:15 +0200
committerChristophe Coevoet <stof@notk.org>2012-10-06 15:24:15 +0200
commit77202d4c3d20188f72ac4a53893d52201a360e07 (patch)
tree485be4ea3e1065fd83ab82ce698a7606cb2ac6d9
parentb931ab95447fa8369f4d29400a079f7bdc13da9a (diff)
Replaced the SdE url by the MyECP url
-rw-r--r--lib/Bdu/Entity/Student.php7
-rw-r--r--test/Bdu/Tests/Entity/StudentTest.php8
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/Bdu/Entity/Student.php b/lib/Bdu/Entity/Student.php
index fb91393..0263495 100644
--- a/lib/Bdu/Entity/Student.php
+++ b/lib/Bdu/Entity/Student.php
@@ -151,16 +151,15 @@ class Bdu_Entity_Student
}
/**
- * Retourne l'url de la fiche SdE de l'élève
+ * Retourne l'url de la fiche MyECP de l'élève
*
* @return string
*/
- public function getSdeUrl()
+ public function getMyEcpUrl()
{
$this->retrieve();
- $param = base64_encode(sprintf("onglet=/modules/annuaire/affiche_eleve_tab.php&uid=%s", $this->uid));
- return 'http://www.campus.ecp.fr/modules/annuaire/affiche_eleve.php?param='.$param;
+ return sprintf('http://my.ecp.fr/m/%s', urlencode($this->uid));
}
/**
diff --git a/test/Bdu/Tests/Entity/StudentTest.php b/test/Bdu/Tests/Entity/StudentTest.php
index 8ebbd8e..5aedc25 100644
--- a/test/Bdu/Tests/Entity/StudentTest.php
+++ b/test/Bdu/Tests/Entity/StudentTest.php
@@ -59,12 +59,12 @@ class Bdu_Tests_Entity_StudentTest extends Bdu_Tests_TestCase
$this->fail('An invalid ldap result throws an exception');
}
- public function testSdeUrl()
+ public function testMyEcpUrl()
{
$student = new Bdu_Entity_Student('11goreti', $this->getUnitOfWork());
- $url = $student->getSdeUrl();
- $this->assertInternalType('string', $url, '->getSdeUrl returns a string');
- $this->assertStringStartsWith('http://www.campus.ecp.fr/modules/annuaire/affiche_eleve.php?param=', $url);
+ $url = $student->getMyEcpUrl();
+ $this->assertInternalType('string', $url, '->getMyEcpUrl returns a string');
+ $this->assertEquals('http://my.ecp.fr/m/11goreti', $url);
}
public function testPhoto()