Skip to content
Snippets Groups Projects
Commit ae6618be authored by Ghislain Loas's avatar Ghislain Loas
Browse files

hotline_#18504_pergame_exemplaire_same_id_origine_between_album_and_sigb fix test failures

parent 5ddc664b
Branches
Tags
4 merge requests!715Master,!664report fix from stable to wip,!663Stable,!654Hotline #18504 pergame exemplaire same id origine between album and sigb
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
include_once 'NanookFixtures.php';
......@@ -171,24 +171,24 @@ class NanookHtmlResponseErrorTest extends NanookServiceErrorTestCase {
/** @test */
public function reservationsShouldBeEmpty() {
$this->assertEmpty($this->_emprunteur->getReservations());
$this->assertEmpty($this->_emprunteur->getReservations());
}
/** @test */
public function pretsRetardShouldBeEmpty() {
$this->assertEmpty($this->_emprunteur->getPretsEnRetard());
$this->assertEmpty($this->_emprunteur->getPretsEnRetard());
}
/** @test */
public function empruntsShouldBeEmpty() {
$this->assertEmpty($this->_emprunteur->getEmprunts());
$this->assertEmpty($this->_emprunteur->getEmprunts());
}
/** @test */
public function validShouldBeFalse() {
$this->assertFalse($this->_emprunteur->isValid());
$this->assertFalse($this->_emprunteur->isValid());
}
}
......@@ -203,7 +203,9 @@ class NanookGetNoticeLiliGrisbiAndCoTest extends NanookTestCase {
public function setUp() {
parent::setUp();
//Pour avoir les textes de prets par defaut
Class_Profil::getCurrentProfil()->setCfgNotice(array('exemplaires' => array()));
Class_Profil::setCurrentProfil($this->fixture('Class_Profil',
['id' => 1,
'libelle' => 'default profil']));
$this->_mock_web_client
->whenCalled('open_url')
......@@ -408,13 +410,13 @@ class NanookGetEmprunteurChristelDelpeyrouxTest extends NanookTestCase {
/** @test */
public function emprunteurShouldBeValid() {
$this->assertTrue($this->_emprunteur->isValid());
$this->assertTrue($this->_emprunteur->isValid());
}
/** @test */
public function emprunteurPasswordShouldBe2002() {
$this->assertEquals('2002', $this->_emprunteur->getPassword());
$this->assertEquals('2002', $this->_emprunteur->getPassword());
}
......@@ -459,7 +461,7 @@ class NanookGetEmprunteurChristelDelpeyrouxTest extends NanookTestCase {
$this->assertEquals('1 rue des fleurs', $this->_emprunteur->getAdresse());
}
/** @test */
public function codePostalShouldBe74000() {
$this->assertEquals('74000', $this->_emprunteur->getCodePostal());
......@@ -488,7 +490,7 @@ class NanookGetEmprunteurChristelDelpeyrouxTest extends NanookTestCase {
$this->assertEquals('01 23 45 67 89', $this->_chrystel->getTelephone());
$this->assertEquals('1978-11-10', $this->_chrystel->getNaissance());
}
/** @test */
public function nbEmpruntsShouldBeThree() {
......@@ -631,7 +633,7 @@ class NanookGetEmprunteurChristelDelpeyrouxTest extends NanookTestCase {
/** @test */
public function firstReservationEtatShouldBePasDisponibleAvantLe15Juin2012() {
$this->assertEquals('Pas disponible avant le 15/06/2012',
$this->assertEquals('Pas disponible avant le 15/06/2012',
$this->_emprunteur->getReservationAt(0)->getEtat());
}
......@@ -744,7 +746,7 @@ class NanookGetEmprunteurAuthenticateTest extends NanookTestCase {
->whenCalled('open_url')
->with('http://localhost:8080/afi_Nanook/ilsdi/service/GetPatronInfo/patronId/1')
->answers(NanookFixtures::xmlGetPatronError());
$emprunteur = $this->_service->getEmprunteur($user = Class_Users::newInstance()
->setLogin('90175000410218')
->setPassword('1989'));
......@@ -755,7 +757,7 @@ class NanookGetEmprunteurAuthenticateTest extends NanookTestCase {
}
/** @test */
public function withWrongPasswordEmprunteurShouldNotBeValid() {
$this->_mock_web_client
......@@ -766,7 +768,7 @@ class NanookGetEmprunteurAuthenticateTest extends NanookTestCase {
->whenCalled('open_url')
->with('http://localhost:8080/afi_Nanook/ilsdi/service/GetPatronInfo/patronId/1')
->answers(NanookFixtures::xmlGetPatronChristelDelpeyroux());
$emprunteur = $this->_service->getEmprunteur($user = Class_Users::newInstance()
->setLogin('90175000410218')
->setPassword('1989')
......@@ -777,7 +779,7 @@ class NanookGetEmprunteurAuthenticateTest extends NanookTestCase {
$this->assertFalse($emprunteur->isValid());
$this->assertEmpty($emprunteur->getPassword());
}
}
......@@ -947,13 +949,13 @@ class NanookSaveEmprunteurPostTest extends NanookTestCase {
parent::setup();
$this->_mock_web_client
->whenCalled('postData')
->with('http://localhost:8080/afi_Nanook/ilsdi/service/UpdatePatronInfo/patronId/1',
->with('http://localhost:8080/afi_Nanook/ilsdi/service/UpdatePatronInfo/patronId/1',
['password' => '987654@afi-sa.fr',
'mail' => 'gloas@afi-sa.fr',
'phoneNumber' => '0123456789'])
->answers(NanookFixtures::xmlGetPatronChristelDelpeyrouxAfterPost())
->beStrict();
$this->_crystel = Class_WebService_SIGB_Emprunteur::newInstance(1)
->setPassword('987654@afi-sa.fr')
->setEmail('gloas@afi-sa.fr')
......@@ -966,7 +968,7 @@ class NanookSaveEmprunteurPostTest extends NanookTestCase {
public function christelDelPeyrouxShoudlHaveGloasAsEmail() {
$this->assertEquals('gloas@afi-sa.fr', $this->_emprunteur->getEmail());
}
/** @test **/
public function christelDelPeyrouxShoudlHave0123456789AsTelpehone() {
$this->assertEquals('0123456789', $this->_emprunteur->getTelephone());
......@@ -992,13 +994,13 @@ class NanookSaveEmprunteurRecordNotFoundTest extends NanookTestCase {
parent::setup();
$this->_mock_web_client
->whenCalled('postData')
->with('http://localhost:8080/afi_Nanook/ilsdi/service/UpdatePatronInfo/patronId/1',
->with('http://localhost:8080/afi_Nanook/ilsdi/service/UpdatePatronInfo/patronId/1',
['password' => '987654@afi-sa.fr',
'mail' => 'gloas@afi-sa.fr',
'phoneNumber' => '0123456789'])
->answers(NanookFixtures::xmlRecordNotFound())
->beStrict();
$this->_crystel = Class_WebService_SIGB_Emprunteur::newInstance(1)
->setPassword('987654@afi-sa.fr')
->setEmail('gloas@afi-sa.fr')
......@@ -1012,7 +1014,7 @@ class NanookSaveEmprunteurRecordNotFoundTest extends NanookTestCase {
public function christelDelPeyrouxShoudlNotBeValidWithRecordNotFoundError() {
$this->assertFalse($this->_emprunteur->isValid());
}
}
......@@ -1023,13 +1025,13 @@ class NanookSaveEmprunteurUpdatePatronErrorTest extends NanookTestCase {
parent::setup();
$this->_mock_web_client
->whenCalled('postData')
->with('http://localhost:8080/afi_Nanook/ilsdi/service/UpdatePatronInfo/patronId/1',
->with('http://localhost:8080/afi_Nanook/ilsdi/service/UpdatePatronInfo/patronId/1',
['password' => '987654@afi-sa.fr',
'mail' => 'gloas@afi-sa.fr',
'phoneNumber' => '0123456789'])
->answers(NanookFixtures::xmlUpdatePatronError())
->beStrict();
$this->_crystel = Class_WebService_SIGB_Emprunteur::newInstance(1)
->setPassword('987654@afi-sa.fr')
->setEmail('gloas@afi-sa.fr')
......@@ -1042,7 +1044,5 @@ class NanookSaveEmprunteurUpdatePatronErrorTest extends NanookTestCase {
public function christelDelPeyrouxShoudlNotBeValidWithUpdatePatron() {
$this->assertFalse($this->_emprunteur->isValid());
}
}
?>
}
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