From 2d9564ba9521ce469b4184517b6b2c055d285094 Mon Sep 17 00:00:00 2001 From: gloas <gloas@afi-sa.fr> Date: Thu, 11 May 2017 17:34:56 +0200 Subject: [PATCH] dev #40650 pre inscription fix tests fixtures --- .../AuthControllerPreRegistrationTest.php | 45 ++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/tests/application/modules/opac/controllers/AuthControllerPreRegistrationTest.php b/tests/application/modules/opac/controllers/AuthControllerPreRegistrationTest.php index 8d3b0f47273..37104dd5999 100644 --- a/tests/application/modules/opac/controllers/AuthControllerPreRegistrationTest.php +++ b/tests/application/modules/opac/controllers/AuthControllerPreRegistrationTest.php @@ -286,12 +286,15 @@ class AuthControllerPreRegistrationNanookPostDispatchTest $this->mock_web_client ->whenCalled('postData') ->with('http://super.nano.ok/ilsdi/arcadia/service/pre-register', - ['site' => '1', + ['site' => 1, 'lastName' => 'Jiro', 'firstName' => 'Tom', 'mail' => 'test@test.fr', - 'password' => 'pwd', - 'birthDate' => '2001-05-05']) + 'password' => 'pwd123456', + 'birthDate' => '2001-05-05', + 'town' => 'titi', + 'zipcode' => '123456', + 'address' => '123']) ->answers(NanooKFixtures::xmlGetPatronInfoFrancoisMorel()); $this->postDispatch('/opac/auth/pre-registration', ['site' => '1', @@ -299,9 +302,12 @@ class AuthControllerPreRegistrationNanookPostDispatchTest 'firstName' => 'Tom', 'mail' => 'test@test.fr', 'mail2' => 'test@test.fr', - 'password' => 'pwd', - 'password2' => 'pwd', - 'birthDate' => '2001-05-05']); + 'password' => 'pwd123456', + 'password2' => 'pwd123456', + 'birthDate' => '2001-05-05', + 'town' => 'titi', + 'zipcode' => '123456', + 'address' => '123']); } @@ -313,7 +319,7 @@ class AuthControllerPreRegistrationNanookPostDispatchTest /** @test */ public function responseShouldRedirectToPreRegistrationSuccess() { - $this->assertRedirectTo('http://localhost' . BASE_URL . '/auth/pre-registration-success/site/1/lastName/Jiro/firstName/Tom/mail/test%40test.fr/mail2/test%40test.fr/password/pwd/password2/pwd/birthDate/2001-05-05'); + $this->assertRedirectTo('http://localhost' . BASE_URL . '/auth/pre-registration-success/site/1/lastName/Jiro/firstName/Tom/mail/test%40test.fr/mail2/test%40test.fr/password/pwd123456/password2/pwd123456/birthDate/2001-05-05/town/titi/zipcode/123456/address/123'); } @@ -334,12 +340,15 @@ class AuthControllerPreRegistrationNanookPostDispatchErrorTest $this->mock_web_client ->whenCalled('postData') ->with('http://super.nano.ok/ilsdi/arcadia/service/pre-register', - ['site' => '1', + ['site' => 1, 'lastName' => 'Jiro', 'firstName' => 'Tom', 'mail' => 'test@test.fr', - 'password' => 'pwd', - 'birthDate' => '2001-05-05']) + 'password' => 'pwd123456', + 'birthDate' => '2001-05-05', + 'town' => 'titi', + 'zipcode' => '123456', + 'address' => '123']) ->answers('<?xml version="1.0" encoding="UTF-8"?><error>PreRegisterUserError</error></>'); $this->postDispatch('/opac/auth/pre-registration', ['site' => '1', @@ -347,19 +356,24 @@ class AuthControllerPreRegistrationNanookPostDispatchErrorTest 'firstName' => 'Tom', 'mail' => 'test@test.fr', 'mail2' => 'test@test.fr', - 'password' => 'pwd', - 'password2' => 'pwd', - 'birthDate' => '2001-05-05']); + 'password' => 'pwd123456', + 'password2' => 'pwd123456', + 'birthDate' => '2001-05-05', + 'town' => 'titi', + 'zipcode' => '123456', + 'address' => '123']); } /** @test */ public function responseShouldRedirectToPreRegistrationError() { - $this->assertRedirectTo('http://localhost' . BASE_URL . '/auth/pre-registration/site/1/lastName/Jiro/firstName/Tom/mail/test%40test.fr/mail2/test%40test.fr/password/pwd/password2/pwd/birthDate/2001-05-05'); + $this->assertRedirectTo('http://localhost' . BASE_URL . '/auth/pre-registration/site/1/lastName/Jiro/firstName/Tom/mail/test%40test.fr/mail2/test%40test.fr/password/pwd123456/password2/pwd123456/birthDate/2001-05-05/town/titi/zipcode/123456/address/123'); } } + + class AuthControllerPreRegistrationWithNoPreRegistrationTest extends AuthControllerPreRegistrationNanookTestCase { public function setUp() { parent::setUp(); @@ -368,7 +382,8 @@ class AuthControllerPreRegistrationWithNoPreRegistrationTest extends AuthControl $this->dispatch('/opac/auth/pre-registration', true); } -/** @test */ + + /** @test */ public function pageShouldDisplayErrorPreinscriptionDeactivated() { $this->assertFlashMessengerContentContains('Cette fonctionnalité n\'est pas activé'); } -- GitLab