Commit 71356749 authored by Laurent's avatar Laurent

Merge branch 'hotline#109386_formations_export_ajouter_bib_de_l_usager' into 'hotline'

hotline #109386 : add mail and library in trainees export

See merge request !3574
parents 63e38bac 01814a9c
Pipeline #10649 passed with stage
in 46 minutes and 44 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 ...@@ -61,12 +61,16 @@ abstract class Admin_ActivityControllerTestCase extends Admin_AbstractController
'prenom' => 'Benoit', 'prenom' => 'Benoit',
'user_groups' => [$this->_groupe_stagiaires]]); 'user_groups' => [$this->_groupe_stagiaires]]);
$this->fixture('Class_Bib', ['id' => 12, 'libelle' => 'Annecy']);
$this->_patrick = $this->fixture('Class_Users', $this->_patrick = $this->fixture('Class_Users',
['id' => 5, ['id' => 5,
'id_site' => 12,
'login' => 'Pat', 'login' => 'Pat',
'password' => '123', 'password' => '123',
'prenom' => 'Patrick', 'prenom' => 'Patrick',
'nom' => 'Barroca', 'nom' => 'Barroca',
'mail' => 'user@server.org',
'user_groups' => [$this->_groupe_stagiaires]]); 'user_groups' => [$this->_groupe_stagiaires]]);
$this->_salle_reunion = $this->fixture('Class_Lieu', $this->_salle_reunion = $this->fixture('Class_Lieu',
...@@ -1467,7 +1471,7 @@ class Admin_ActivityControllerInscriptionsSessionMarsJavaTest extends Admin_Act ...@@ -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() { public function setUp() {
parent::setUp(); parent::setUp();
$this->dispatch('/admin/session-activity/export_inscriptions/id/32', true); $this->dispatch('/admin/session-activity/export_inscriptions/id/32', true);
...@@ -1476,33 +1480,32 @@ class Admin_ActivityControllerExportInscriptionsSessionMarsJavaTest extends Adm ...@@ -1476,33 +1480,32 @@ class Admin_ActivityControllerExportInscriptionsSessionMarsJavaTest extends Adm
/** @test */ /** @test */
public function responseHeaderShouldHaveContentTypeCSV() { public function responseHeaderShouldHaveContentTypeCSV() {
$this->assertHeaderContains('Content-Type', 'text/csv;charset=utf-8'); $this->assertHeaderContains('Content-Type', 'text/csv; name="session_32.csv"');
} }
/** @test */ /** @test */
public function responseHeaderShouldHaveContentDispositionAttachment() { public function responseHeaderShouldHaveContentDispositionAttachment() {
$this->assertHeaderContains('Content-Disposition', $this->assertHeaderContains('Content-Disposition', 'attachment; filename="session_32.csv"');
'attachment; filename="session_32.csv"');
} }
/** @test */ /** @test */
public function contentShouldContainsPatAndBenoit() { public function contentShouldContainsPatAndBenoit() {
$this->assertContains("Nom;Prénom;Identifiant\n". $this->assertContains("\n\nNom;Prénom;Identifiant;Mail;Bibliothèque\n".
"Anonyme;;n/a\n". "Anonyme;;n/a;;\n".
"Barroca;Patrick;Pat\n". "Barroca;Patrick;Pat;user@server.org;Annecy\n".
"Curzillat;Benoit;Benoit\n", "Curzillat;Benoit;Benoit;;\n",
$this->_response->getBody()); $this->_response->getBody());
} }
/** @test */ /** @test */
public function contentShouldContainsDetailSession() { public function contentShouldContainsDetailSession() {
$this->assertContains("Activité;Learn Java;\n". $this->assertContains("Activité;\"Learn Java\"\n".
"Session;27 mars 2012;\n". "Session;\"27 mars 2012\"\n".
"Durée;8h;\n". "Durée;8h\n".
"Effectif;5-25;\n", "Effectif;5-25\n",
$this->_response->getBody()); $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