Commit bf469fdc authored by Laurent's avatar Laurent

Merge branch 'hotline'

parents e3237c15 759ed1f5
Pipeline #10524 failed with stage
in 62 minutes and 41 seconds
30/06/2020 - v8.0.68
- ticket #109494 : PNB Dilicom : Correction d'une erreur lors de l'export des prèts quand l'album dilicom a été supprimé
- ticket #109428 : PNB Dilicom : Correction du calcul des prêts en cours
- ticket #109427 : Magasin de thème : correction de la pagination/recherche dans la liste verticale à interactions
- ticket #113717 : Magasin de thèmes / boite agenda : correction de la prise en compte des paramètres de boîte
- ticket #113598 : Support international dans l'affichage des notices non trouvées
- ticket #112284 : Inspector Gadget : Ajout de la visualisation des requetes transmises aux SIGB lors de la connexion de l'utilisateur.
- ticket #113526 : SIGB Dynix : Cosmogramme : rend disponible la configuration des mails à envoyer aux différentes bibliothèques lors de la réservation d'un documente disponible
25/06/2020 - v8.0.67
- suppression de l'annonce des webinaires
......
......@@ -161,8 +161,11 @@ class AuthController extends ZendAfi_Controller_Action {
public function loginAction() {
$this->view->preferences = $this->_loginPrefFromWidgetOrModule();
$redirect = $this->_getParam('redirect', '/opac');
$redirect = $this->_getParam('redirect', Class_Url::relative(['module' => 'opac',
'action' => 'index',
'controller' => 'index']));
$this->view->redirect = $redirect;
$service = $this->_getParam('service','');
$this->view->service = $service;
......
......@@ -3,11 +3,20 @@ $url_action = $this->form_action ?
$this->form_action : $this->url(['controller' => 'auth',
'action' => ('boite-login'),
'id_module' => $this->id_module]);
$datas = ['redirect_url' => $this->redirect,
'service' => $this->service,
'id_notice' => $this->id_notice];
if ($inspector_gadget = Zend_Controller_Front::getInstance()
->getPlugin('ZendAfi_Controller_Plugin_InspectorGadget'))
$datas = $inspector_gadget->addToParams($datas);
echo $this->Widget_Login(
new Class_Entity(array_merge(['Preferences' => $this->preferences],
['FormOptions' => ['data' => array_merge($this->preferences,
['redirect_url' => $this->redirect,
'service' => $this->service,
'id_notice' => $this->id_notice]),
$datas),
'action' => $url_action]])));
......@@ -157,7 +157,12 @@ function getBlocsParams($id_bib, $type, $valeurs) {
$champs_params[0] = ['url_serveur', 'catalogue_web', 'reserver_retrait_bib_abonne'];
if ($clef == Class_IntBib::COM_DYNIX)
$champs_params[0] = ['url_serveur', 'client_id'];
$champs_params[0] = ['url_serveur',
'client_id',
['mails_bib' => function($id, $valeur)
{
return getTextArea($id, $valeur, 60, 20);
}]];
if ($clef == Class_IntBib::COM_Z3950)
$champs_params[0] = ['url_serveur', 'login', 'password', 'nom_base'];
......
......@@ -216,7 +216,7 @@ class Class_Calendar {
}
protected function _getNextEvents(){
protected function _getNextEvents($fill_with_following_months = true){
$time = $this->getTimeSource()->time();
$prefs = [];
if ($this->date == strftime('%Y-%m',$time))
......@@ -224,6 +224,9 @@ class Class_Calendar {
$articles = $this->_loadArticles($prefs);
if (!$fill_with_following_months)
return $articles;
if (count($articles) < $this->_getSize()
&& $this->preferences['event_filter'] == 'none') {
$next_articles = $this->_loadArticles(['event_start_after' => $this->date,
......@@ -271,25 +274,17 @@ class Class_Calendar {
}
public function getArticles() {
public function getArticles($fill_with_following_months = true) {
$articles = isset($this->day)
? $this->_loadArticles(['event_date' => $this->day])
: $this->_getNextEvents();
return array_slice($articles, 0, $this->_getSize());
}
: $this->_getNextEvents($fill_with_following_months);
public function getArticlesInMonth() {
$articles = Class_Article::getArticlesByPreferences(['event_date'=> self::getTimeSource()->getMonth($this->month),
'events_only' => true,
'status' => 3]);
return array_slice($articles, 0, $this->_getSize());
}
public function getNextEvents() {
$articles = $this->_getNextEvents();
public function getNextEvents($fill_with_following_months = true) {
$articles = $this->_getNextEvents($fill_with_following_months);
return array_slice($articles, 0, $this->_getSize());
}
......
......@@ -143,7 +143,7 @@ class CatalogueLoader extends Storm_Model_Loader {
if (!Class_NoticeDomain::getClesNoticesForDomain($catalogue->getId()))
return '';
return Class_MoteurRecherche::prepareFacetteDomainForOrConditions($catalogue->getId());
return (new Class_MoteurRecherche())->prepareFacetteDomainForOrConditions($catalogue->getId());
}
......
......@@ -152,7 +152,10 @@ class Class_Loan_Pnb extends Storm_Model_Abstract {
public function getItem() {
foreach(Class_Album_Item::findAllBy(['album_id' => $this->getAlbum()->getId()])
if (!$album = $this->getAlbum())
return;
foreach(Class_Album_Item::findAllBy(['album_id' => $album->getId()])
as $item)
if ($item->getOrderLineId() == $this->getOrderLineId())
return $item;
......
......@@ -43,7 +43,7 @@ class Class_MoteurRecherche {
public function __construct() {
$this->ix = new Class_Indexation;
$this->ix = Class_Indexation::getInstance();
$this->_type_condition = 'type=' . Class_Notice::TYPE_BIBLIOGRAPHIC;
}
......
......@@ -67,7 +67,7 @@ class Class_TableDescription_PNBItemsRenderer {
public function getLiveQuantity() {
return $this->getLoanCountOrLocalOngoing()
return $this->getLocalOngoingCount()
. ' / '
. $this->_item->getLoanAllowedNumberOfUsers();
}
......
......@@ -155,6 +155,12 @@ class Class_Url {
*/
public static function assemble(array $urlOptions = array(), $name = null, $reset = true, $encode = true) {
$router = Zend_Controller_Front::getInstance()->getRouter();
$inspector_gadget = Zend_Controller_Front::getInstance()
->getPlugin('ZendAfi_Controller_Plugin_InspectorGadget');
if ($inspector_gadget)
$urlOptions = $inspector_gadget->addToParams($urlOptions);
return $router->assemble($urlOptions, $name, $reset, $encode);
}
......@@ -266,12 +272,6 @@ Bokeh Error : adminVar "NOM_DOMAINE" is empty. Bokeh in php cli mode is unable t
if (is_string($url_array_or_string))
return static::_beginWithSlash($url_array_or_string);
$inspector_gadget = Zend_Controller_Front::getInstance()
->getPlugin('ZendAfi_Controller_Plugin_InspectorGadget');
if ($inspector_gadget)
$url_array_or_string = $inspector_gadget->addToParams($url_array_or_string);
return static::assemble($url_array_or_string, $name, $reset, $encode);
}
}
......@@ -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
*/
class Class_WebService_SIGB_Abstract {
protected static $service;
......@@ -40,5 +40,16 @@ class Class_WebService_SIGB_Abstract {
public static function reset() {
static::$service = null;
}
public static function decodeMapping($str_codif) {
$codifs = [];
$lines = array_filter(explode("\n", trim($str_codif)));
foreach($lines as $line) {
$code_libelle = explode(':', $line);
$codifs[trim($code_libelle[0])] = trim($code_libelle[1]);
}
return $codifs;
}
}
?>
\ No newline at end of file
......@@ -16,11 +16,13 @@
*
* 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
*/
class Class_WebService_SIGB_Dynix extends Class_WebService_SIGB_Abstract {
public static function getService($params){
return parent::getService($params)->setClientId($params['client_id']);
return parent::getService($params)
->setClientId($params['client_id'])
->setMailsBib(static::decodeMapping($params['mails_bib']));
}
}
......
......@@ -20,21 +20,8 @@
*/
class Class_Webservice_SIGB_Dynix_Service extends Class_WebService_SIGB_AbstractRESTService {
protected $_client_id;
protected $_mail_bib = [
'ALFAX1'=>'bibliotheque.alfortville.annexe@agglo-plainecentrale94.fr',
'ALFMEDA'=>'malfortville@agglo-plainecentrale94.fr',
'CRETBLE'=>'biblibleuets@agglo-plainecentrale94.fr',
'CRETMES'=>'bibliotheque.creteil.biblimesly@agglo-plainecentrale94.fr',
'CRETBUS'=>'bibliotheque.creteil.bibliobus@agglo-plainecentrale94.fr',
'CRETMEC'=>'bibliotheque.creteil.meches@agglo-plainecentrale94.fr',
'CRETDOY'=>'mediatheque.creteil.abbaye@agglo-plainecentrale94.fr',
'ENMDAD'=>'',
'CRETHAB'=>'medialudo.creteil@gpsea.fr',
'CRETMAC'=>'mediabus@gpsea.fr',
'CRETMUL'=>'',
'CRETRES'=>'bibliotheque.creteil.servicesinternes@agglo-plainecentrale94.fr',
'CRETVIL'=>'mediatheque.creteil.village@agglo-plainecentrale94.fr',
'LB'=>'bibliotheque.limeilbrevannes@agglo-plainecentrale94.fr'];
protected $_mail_bib = [];
/**
* @param string $server_root
......@@ -47,6 +34,12 @@ class Class_Webservice_SIGB_Dynix_Service extends Class_WebService_SIGB_Abstract
}
public function setMailsBib($mails_bib) {
$this->_mail_bib = $mails_bib;
return $this;
}
public function setClientId($client_id) {
$this->_client_id = $client_id;
return $this;
......
......@@ -50,8 +50,8 @@ class Class_WebService_SIGB_Koha {
$service = $service_class::getService($params);
$service
->setCodificationDisponibilites(static::decodeMapping($params['Codification_disponibilites']))
->setWithdrawnMapping(static::decodeMapping($params['withdrawn_mapping']))
->setCodificationDisponibilites(Class_WebService_SIGB_Abstract::decodeMapping($params['Codification_disponibilites']))
->setWithdrawnMapping(Class_WebService_SIGB_Abstract::decodeMapping($params['withdrawn_mapping']))
->setGroupedHoldsITypes(array_filter(explode("\n", $params['grouped_holds_itypes'])))
->setBundledHoldsMinimalDuration($params['bundled_holds_minimal_duration'])
->setBundledHoldsMaximalDuration($params['bundled_holds_maximal_duration']);;
......@@ -63,17 +63,6 @@ class Class_WebService_SIGB_Koha {
}
public static function decodeMapping($str_codif) {
$codifs = [];
$lines = array_filter(explode("\n", trim($str_codif)));
foreach($lines as $line) {
$code_libelle = explode(':', $line);
$codifs[trim($code_libelle[0])] = trim($code_libelle[1]);
}
return $codifs;
}
public static function setService($params, $service) {
static::$services[static::makeKey($params)] = $service;
}
......
......@@ -93,6 +93,7 @@ class Class_WebService_Vignette extends Class_WebService_Abstract {
static function renderThumbnail($id_notice,$titre,$type_doc) {
$image = static::createImage($titre, 300, 400, $type_doc);
imagepng($image);
}
......@@ -129,7 +130,9 @@ class Class_WebService_Vignette extends Class_WebService_Abstract {
public static function writeText ($titre, $image_obj, $position = 0) {
// Tronçonner le texte
$texte=wordwrap(utf8_decode(str_replace('<br />', ';', $titre)), 12, ';');
$texte=wordwrap(str_replace('<br />', ';', $titre), 12, ';');
$texte=explode(";", $texte);
// Parametres
......@@ -142,7 +145,7 @@ class Class_WebService_Vignette extends Class_WebService_Abstract {
// Afficher
foreach($texte as $ligne) {
imagettftext($image_obj, 30, 0, $pos_x, $pos_y, $couleur, PATH_FONTS . 'Vera.ttf', trim($ligne));
imagettftext($image_obj, 30, 0, $pos_x, $pos_y, $couleur, PATH_FONTS . 'OpenSans.ttf', $ligne);
$pos_y += $hauteur;
}
......
......@@ -25,7 +25,7 @@
*/
trait Trait_AlbumDelegator {
public function getNoticeOPACId() {
return $this->getAlbum()->getNoticeId();
return $this->_withAlbumGet('notice_id');
}
......@@ -40,42 +40,44 @@ trait Trait_AlbumDelegator {
public function getTitle() {
return $this->getAlbum()->getTitre();
return $this->_withAlbumGet('titre', '');
}
public function getMainAuthor() {
return $this->getAlbum()->getMainAuthorName();
return $this->_withAlbumGet('main_author_name', '');
}
public function getFirstEditor() {
return $this->getAlbum()->getFirstEditor();
return $this->_withAlbumGet('first_editor', '');
}
public function getFirstCollection() {
return $this->getAlbum()->getFirstCollection();
return $this->_withAlbumGet('first_collection', '');
}
public function getYear() {
return $this->getAlbum()->getAnnee();
return $this->_withAlbumGet('annee', '');
}
public function getFirstKind() {
return $this->getFirstLabelFromAlbumCodif('Class_CodifGenre', $this->getAlbum()->getGenre());
return $this->getFirstLabelFromAlbumCodif('Class_CodifGenre',
$this->_withAlbumGet('genre', ''));
}
public function getFirstSection() {
return $this->getFirstLabelFromAlbumCodif('Class_CodifSection', $this->getAlbum()->getSections());
return $this->getFirstLabelFromAlbumCodif('Class_CodifSection',
$this->_withAlbumGet('sections'));
}
public function getCategory() {
return $this->getAlbum()->getCategoryLabel();
return $this->_withAlbumGet('category_label', '');
}
......@@ -85,4 +87,11 @@ trait Trait_AlbumDelegator {
? ''
: $labels->first();
}
protected function _withAlbumGet($attribute, $default=null) {
return ($album = $this->getAlbum())
? $album->callGetterByAttributeName($attribute)
: $default;
}
}
......@@ -112,6 +112,15 @@ class ZendAfi_Form_Login extends ZendAfi_Form {
array_push($group, 'redirect');
}
if (isset($this->_data['inspector_gadget'])) {
$this->addElement('hidden',
'inspector_gadget',
['value' => $this->_data['inspector_gadget']]);
array_push($group, 'inspector_gadget');
}
if(strlen($this->_service)>1){
$this->addElement('hidden',
'service',
......
......@@ -81,7 +81,7 @@ class Bokeh_Engine {
function setupConstants() {
defineConstant('BOKEH_MAJOR_VERSION','8.0');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.67');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.68');
defineConstant('BOKEH_REMOTE_FILES', 'https://git.afi-sa.net/afi/opacce/');
......
......@@ -147,6 +147,7 @@ class Intonation_Library_AjaxPaginatedListHelper {
{
$element
->setView($this->_view)
->setModel($element->getModel())
->inJsSearch();
return false !== strpos(strtolower($element->getContentForJSSearch()), $term);
});
......
......@@ -35,7 +35,7 @@ class Intonation_Library_Widget_Carousel_Agenda_View extends Intonation_Library_
protected function _findElements() {
$this->_initCalendar();
return $this->_calendar->getArticlesInMonth();
return $this->_calendar->getArticles($fill_with_following_months = false);
}
......
......@@ -32,6 +32,7 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe
$callback = function($element) use ($helper) {
$element->setView($this->view);
$element->setModel($element->getModel());
return call_user_func_array([$this->view, $helper->getRendering()], [$element]);
};
......@@ -62,7 +63,7 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe
$page_size = $helper->getPageSize();
$count_pages = ceil( $count_result / $page_size );
$count_pages = $count_pages < 1 ? 1 : $count_pages ;
return $this->view->div([],
implode([$this->view->tagAnchor(['controller' => 'index',
'action' => 'ajax-paginated-list',
......@@ -79,6 +80,7 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe
$this->view->tagAnchor(['controller' => 'index',
'action' => 'ajax-paginated-list',
'id_profil' => Class_Profil::getCurrentProfil()->getId(),
'id' => $this->_id,
'page' => $current_page +1],
$this->_tag('i','',['class' => 'fas fa-chevron-right m-0']),
......@@ -95,6 +97,7 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe
$form
->setAction($this->view->url(['controller' => 'index',
'action' => 'ajax-paginated-list',
'id_profil' => Class_Profil::getCurrentProfil()->getId(),
'id' => $this->_id,
'size' => $helper->getPageSize(),
'page' => 1], null, true))
......
......@@ -155,6 +155,15 @@ class AuthControllerAbonneSIGBLoggedTest extends PortailWithOneLoginModuleTestCa
$this->assertXPathContentContains('//div[@class="barre_nav"]/span','Connexion');
}
/** @test */
public function pageShouldkeepInspectorGadgetInForm() {
$this->bootstrap();
$this->dispatch('/opac/auth/login?inspector_gadget=keep',true);
$this->assertXPath('//form//input[@type="hidden"][@name="inspector_gadget"][@value="keep"]', $this->_response->getBody());
}
}
......@@ -1072,7 +1081,7 @@ class AuthControllerPostSimpleSuccessfulTest extends AuthControllerPostSimpleSuc
/** @test */
public function responseShouldBeARedirectToOPAC() {
$this->assertRedirectTo('/opac');
$this->assertRedirectTo('/');
}
......@@ -1334,7 +1343,7 @@ class AuthControllerPostSimpleFailureTest extends AuthControllerPostSimpleTestCa
public function withAuthenticationFailureResponseShouldBeRedirect() {
$this->postDispatch('/opac/auth/login',
['username' => 'foo', 'password' => 'bar']);
$this->assertRedirectTo('/opac');
$this->assertRedirectTo('/');
}
......
......@@ -307,6 +307,16 @@ class AuthControllerWithNanookPostLoginWithMailAndUnsecurePasswordOthersLogins
/** @test */
public function withActionLoginWithInspectorGadgetShouldDisplayButtonWebserviceCalls() {
$this->postDispatch('/opac/auth/login', ['username' => 'name@server.tld',
'password' => '1987',
'inspector_gadget' => 1]);
$this->assertXPathContentContains('//button', 'Appels webservices', $this->_response->getBody());
}
/** @test */
public function withActionAjaxLoginShouldForwardToSecurePassword() {
$this->postDispatch('/opac/auth/ajax-login', ['username' => 'name@server.tld',
'password' => '1987']);
......
......@@ -104,7 +104,7 @@ class AuthControllerWithoutPasswordKohaTest extends AuthControllerWithoutPasswor
public function setUp() {
parent::setUp();
$this->postDispatch('/opac/auth/login', ['username' => 'foo', 'password' => 'bar']);
$this->postDispatch('/opac/auth/login', ['username' => 'foo', 'password' => 'bar' , 'inspector_gadget' => 'keep']);
}
......@@ -124,13 +124,21 @@ class AuthControllerWithoutPasswordKohaTest extends AuthControllerWithoutPasswor
->whenCalled('open_url')
->with('http://mon-koha-de-test.org?service=GetPatronInfo&patron_id=96138&show_contact=0&show_loans=1&show_holds=0')
->answers(KohaFixtures::xmlGetPatronInfoDupont())
->whenCalled('getLastResponse')
->answers(
(new Class_Entity())->setStatus('ok')->setBody(KohaFixtures::xmlAuthenticatePatronOk()))
->whenCalled('getLastRequest')
->answers('true')
->beStrict();
Class_HttpClientFactory::setInstance($this->mock()->whenCalled('getLastHttpClient')->answers($this->_mock_web_client));
$this->_service = Class_WebService_SIGB_Koha::getService($this->_params);
$this->_service->setWebClient($this->_mock_web_client);
}
public function tearDown() {
Class_HttpClientFactory::resetInstance();
parent::tearDown();
}
/** @test */
public function userFooShouldBeLogged() {
......@@ -142,6 +150,14 @@ class AuthControllerWithoutPasswordKohaTest extends AuthControllerWithoutPasswor
public function userFooPasswordShouldHaveNotBeenSet() {
$this->assertEquals('', Class_Users::getIdentity()->getPassword());
}
/** @test */
public function withActionLoginWithInspectorGadgetShouldKeepWebserviceCalls() {
$this->assertRedirectTo('/index/index/inspector_gadget/keep');
$this->assertNotNull(Zend_Registry::get('session')->inspectorCalls);
}
}
......
......@@ -674,7 +674,8 @@ class CommSigbDynixTest extends CommSigbTestCase {
$this->bib_pc94 = Class_IntBib::newInstanceWithId(5)
->setCommParams(["url_serveur" => 'http://www.dynix.fr:8080/capcvm/',
'client_id' => 'SymWS'])
'client_id' => 'SymWS',
'mails_bib' => 'ALFA:alfa@here.fr'])
->setCommSigb(11);
Class_WebService_SIGB_Dynix::setService($this->createMockForService('Dynix'));
......@@ -683,6 +684,11 @@ class CommSigbDynixTest extends CommSigbTestCase {
->expects($this->any())
->method('setClientId')
->will($this->returnValue($this->mock_service));
$this->mock_service
->expects($this->any())
->method('setMailsBib')
->will($this->returnValue($this->mock_service));
}
......@@ -691,7 +697,8 @@ class CommSigbDynixTest extends CommSigbTestCase {
$this->assertEquals(["url_serveur" => 'http://www.dynix.fr:8080/capcvm/',
"type" => Class_IntBib::COM_DYNIX,
'client_id' => 'SymWS',
'id_bib' => 5],
'id_bib' => 5,
'mails_bib' => 'ALFA:alfa@here.fr'],
$this->bib_pc94->getModeComm(5));
}
}
......
......@@ -27,7 +27,8 @@ class DynixGetServiceTest extends ModelTestCase {
public function setUp() {
Class_WebService_SIGB_Dynix::reset();
$this->_service = Class_WebService_SIGB_Dynix::getService(['url_serveur' => 'http://www.infocom94.fr:8080/capcvm/',
'client_id' => 'myid']);
'client_id' => 'myid',
'mails_bib' => "CRETBUS:mediatheque.creteil.bibliobus@gpsea.fr\nALFMEDA:malfortville@agglo-plainecentrale94.fr"]);
}
......@@ -58,7 +59,8 @@ abstract class DynixTestCase extends ModelTestCase {
Class_WebService_SIGB_Dynix::setService(null);
$this->_service = Class_WebService_SIGB_Dynix
::getService(['url_serveur' => 'http://www.infocom94.fr:8080/capcvm/',
'client_id' => 'SymWS'])
'client_id' => 'SymWS',
'mails_bib' => "CRETBUS:mediatheque.creteil.bibliobus@gpsea.fr\nALFMEDA:malfortville@agglo-plainecentrale94.fr"])
->setWebClient($this->_mock_web_client);
......@@ -638,7 +640,8 @@ class DynixAuthenticateManuLarcinetTest extends DynixTestCase {
['id' => 94,
'comm_sigb' => Class_IntBib::COM_DYNIX,
'comm_params' => ['url_serveur' => 'http://www.infocom94.fr:8080/capcvm/',
'client_id' => 'SymWS']]);
'client_id' => 'SymWS',
'mails_bib' => '']]);
ZendAfi_Auth::getInstance()->authenticateLoginPassword('0917036', 'secret');
}
......
......@@ -234,21 +234,48 @@ class AuthorPageViewAuthorWithoutRecordTest extends AuthorPageTestCase {
class AuthorPageViewByIdTest extends AuthorPageTestCase {
class AuthorPageViewByIdWithInspectorGadgetTest extends AuthorPageTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/author/view/id/2408/inspector_gadget/1');
}
/** @test */
public function biographyTextLesMiserablesShouldBeReplacedByLinkToRecord() {
$this->assertXPathContentContains('//div[@class="biography"]//a[contains(@href, "/recherche/viewnotice/code_rebond/A2408/inspector_gadget/1/id/9")][@title="Accéder au document: Les Misérables"]',
'Les Misérables',$this->_response->getBody());
}
/** @test */
public function pageShouldContainsInspectorGadgetButton() {
$this->assertXPathContentContains('//button[contains(@class,"admin-button")]', 'Auteur Bokeh');
}
/** @test */
public function pageShouldLinkGavrocheWithCodeRebondAndFacet() {
$this->assertXPath('//div[@class="records"]//div[@class="simple_wall"]/a[contains(@href, "/recherche/viewnotice/id/8/inspector_gadget/1/clef/GAVROCHE_HUGO/code_rebond/A2408/facette/T1")]',
$this->_response->getBody());
}
/** @test */
public function pageShouldLinkLesMiserablesWithCodeRebondAndFacet() {
$this->assertXPath('//div[@class="records"]//div[@class="simple_wall"]/a[contains(@href, "/recherche/viewnotice/id/9/inspector_gadget/1/clef/MISERABLES_HUGO/code_rebond/A2408/facette/T1")]');
}
}
class AuthorPageViewByIdTest extends AuthorPageTestCase {