Skip to content
Snippets Groups Projects
Commit 0891e757 authored by Laurent's avatar Laurent
Browse files

First premier chapitre tests

parent cd5974d1
Branches
Tags
1 merge request!1132Hotline#29412 images des articles dans le resultat de recherche
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* 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
*/
/* Ex commande pour lancer phpunit:
* phpunit -c /chemin/absolu/vers/bokeh/tests/phpunit.xml --filter PremierChapitreWithFourBooksTest PremierChapitreWithFourBooksTest /chemin/absolu/vers/bokeh/tests/library/Class/PremierChapitre/PremierChapitreTest.php
*/
class PremierChapitreWithFourBooksTest extends ModelTestCase {
protected
$_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$premier_chapitre = new Class_WebService_PremierChapitre();
$premier_chapitre->updateDatabaseFromFile(__DIR__.'/liste_livres.xml');
}
/** @test */
public function numberOfPremierChapitreInstancesShouldBeFour() {
$this->assertCount(4, Class_PremierChapitre::findAll());
}
/** @test */
public function firstBookTitleShouldBeLaDeconnexionDesElites() {
$this->assertEquals('La déconnexion des élites - Comment Internet dérange l\'ordre établi',
Class_PremierChapitre::find(9782352043645)->getTitre());
}
}
class PremierChapitreInactiveAdminControllerIndexTest extends Admin_AbstractControllerTestCase {
protected
$_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
Class_AdminVar::set('PREMIERCHAPITRE_BIB_ID', '');
$this->dispatch('/admin/premier-chapitre', true);
}
/** @test */
public function h1ShouldContainsPremierChapitre() {
$this->assertXPathContentContains('//h1',
'Premier Chapitre',
$this->_response->getBody());
}
/** @test */
public function divModulesShouldContainsServiceInactif() {
$this->assertXPathContentContains('//div[@class="modules"]',
'Service inactif',
$this->_response->getBody());
}
}
class PremierChapitreActiveAdminControllerIndexTest extends Admin_AbstractControllerTestCase {
protected
$_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
Class_AdminVar::set('PREMIERCHAPITRE_BIB_ID', '123');
Class_AdminVar::set('PREMIERCHAPITRE_BMKEY', 'secret');
Class_AdminVar::set('PREMIERCHAPITRE_BMID', '123');
$this->dispatch('/admin/premier-chapitre', true);
}
/** @test */
public function h1ShouldContainsPremierChapitreIndexDesFonctions() {
$this->assertXPathContentContains('//h1',
'Premier Chapitre :: Index des fonctions',
$this->_response->getBody());
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<premierchapitre>
<livre>
<ean>9782352043645</ean>
<titre>La déconnexion des élites - Comment Internet dérange l'ordre établi</titre>
<url_reader>http://www.premierchapitre.fr/book_reader/index.php?idk=23&amp;idc=d3ee1956c15a614d44e58755af2b1f10</url_reader>
<url_couverture>http://www.moveandread.com/moveandread/multimedia/ebook/1435853131/c/1435853131.png</url_couverture>
<url_couverture_small>http://www.moveandread.com/moveandread/multimedia/ebook/1435853131/c/v/1435853131.png</url_couverture_small>
<auteur_nom>Laure Belot</auteur_nom>
</livre>
<livre>
<ean>9782501098779</ean>
<titre>Comment je suis devenu 10% plus heureux - La méditation pour les sceptiques</titre>
<url_reader>http://www.premierchapitre.fr/book_reader/index.php?idk=23&amp;idc=bcc0c9000e24e091e3a34a98d295aeaf</url_reader>
<url_couverture>http://www.moveandread.com/moveandread/multimedia/ebook/1435848302/c/1435848302.png</url_couverture>
<url_couverture_small>http://www.moveandread.com/moveandread/multimedia/ebook/1435848302/c/v/1435848302.png</url_couverture_small>
<auteur_nom>Dan Harris</auteur_nom>
</livre>
<livre>
<ean>9782809808186</ean>
<titre>Dragon des brumes</titre>
<url_reader>http://www.premierchapitre.fr/book_reader/index.php?idk=23&amp;idc=693952166c663641e5536da1c808ec98</url_reader>
<url_couverture>http://www.moveandread.com/moveandread/multimedia/ebook/1341509609/c/1343672172.png</url_couverture>
<url_couverture_small>http://www.moveandread.com/moveandread/multimedia/ebook/1341509609/c/v/1343672172.png</url_couverture_small>
<auteur_nom>Nicolas Cluzeau</auteur_nom>
</livre>
<livre>
<ean>9782809807769</ean>
<titre>Copycat</titre>
<url_reader>http://www.premierchapitre.fr/book_reader/index.php?idk=23&amp;idc=d28360426420fdf1e613991f05367b07</url_reader>
<url_couverture>http://www.moveandread.com/moveandread/multimedia/ebook/1340887952/c/1401354389.png</url_couverture>
<url_couverture_small>http://www.moveandread.com/moveandread/multimedia/ebook/1340887952/c/v/1401354389.png</url_couverture_small>
<auteur_nom>James Patterson</auteur_nom>
</livre>
</premierchapitre>
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