Commit 01814a9c authored by Patrick Barroca's avatar Patrick Barroca 🐧

hotline #109386 : add mail and library in trainees export

parent 6904ff72
Pipeline #10639 passed with stage
in 44 minutes and 2 seconds
- ticket #109386 : Administration : Activités : Ajout de l'email et de la bibliothèque dans l'export CSV des participants
\ No newline at end of file
......@@ -61,12 +61,16 @@ abstract class Admin_ActivityControllerTestCase extends Admin_AbstractController
'prenom' => 'Benoit',
'user_groups' => [$this->_groupe_stagiaires]]);
$this->fixture('Class_Bib', ['id' => 12, 'libelle' => 'Annecy']);
$this->_patrick = $this->fixture('Class_Users',
['id' => 5,
'id_site' => 12,
'login' => 'Pat',
'password' => '123',
'prenom' => 'Patrick',
'nom' => 'Barroca',
'mail' => 'user@server.org',
'user_groups' => [$this->_groupe_stagiaires]]);
$this->_salle_reunion = $this->fixture('Class_Lieu',
......@@ -1467,7 +1471,7 @@ class Admin_ActivityControllerInscriptionsSessionMarsJavaTest extends Admin_Act
class Admin_ActivityControllerExportInscriptionsSessionMarsJavaTest extends Admin_ActivityControllerTestCase {
class Admin_ActivityControllerExportInscriptionsSessionMarsJavaTest extends Admin_ActivityControllerTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/admin/session-activity/export_inscriptions/id/32', true);
......@@ -1476,33 +1480,32 @@ class Admin_ActivityControllerExportInscriptionsSessionMarsJavaTest extends Adm
/** @test */
public function responseHeaderShouldHaveContentTypeCSV() {
$this->assertHeaderContains('Content-Type', 'text/csv;charset=utf-8');
$this->assertHeaderContains('Content-Type', 'text/csv; name="session_32.csv"');
}
/** @test */
public function responseHeaderShouldHaveContentDispositionAttachment() {
$this->assertHeaderContains('Content-Disposition',
'attachment; filename="session_32.csv"');
$this->assertHeaderContains('Content-Disposition', 'attachment; filename="session_32.csv"');
}
/** @test */
public function contentShouldContainsPatAndBenoit() {
$this->assertContains("Nom;Prénom;Identifiant\n".
"Anonyme;;n/a\n".
"Barroca;Patrick;Pat\n".
"Curzillat;Benoit;Benoit\n",
$this->assertContains("\n\nNom;Prénom;Identifiant;Mail;Bibliothèque\n".
"Anonyme;;n/a;;\n".
"Barroca;Patrick;Pat;user@server.org;Annecy\n".
"Curzillat;Benoit;Benoit;;\n",
$this->_response->getBody());
}
/** @test */
public function contentShouldContainsDetailSession() {
$this->assertContains("Activité;Learn Java;\n".
"Session;27 mars 2012;\n".
"Durée;8h;\n".
"Effectif;5-25;\n",
$this->assertContains("Activité;\"Learn Java\"\n".
"Session;\"27 mars 2012\"\n".
"Durée;8h\n".
"Effectif;5-25\n",
$this->_response->getBody());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment