Skip to content
Snippets Groups Projects
RechercheControllerHistoriqueRechercheTest.php 1.97 KiB
Newer Older
<?php
/**
 * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
 *
Laurent's avatar
Laurent committed
 * 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).
 *
Laurent's avatar
Laurent committed
 * 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
Laurent's avatar
Laurent committed
 * along with BOKEH; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA 
 */
require_once 'AbstractControllerTestCase.php';

class RechercheControllerHistoriqueRechercheTest extends AbstractControllerTestCase {
Patrick Barroca's avatar
Patrick Barroca committed
  public function setUp() {
    parent::setUp();
Patrick Barroca's avatar
Patrick Barroca committed
    Class_Users::getIdentity()->beAdminPortail();
Patrick Barroca's avatar
Patrick Barroca committed
    $criteres_potter = (new Class_CriteresRecherche)
      ->setParams(['expressionRecherche' => 'Harry Potter',
                   'page' => 2]);
Patrick Barroca's avatar
Patrick Barroca committed
    $criteres_davis = (new Class_CriteresRecherche)
      ->setParams(['rech_auteurs' => 'Miles Davis',
                   'annee_fin' => '1970']);
Patrick Barroca's avatar
Patrick Barroca committed
    $session = new Zend_Session_Namespace('historiqueRecherche');
    $session->criteres = [serialize($criteres_potter), serialize($criteres_davis)];
Patrick Barroca's avatar
Patrick Barroca committed
    $this->dispatch('/opac/recherche/saisie', true);
  }
Patrick Barroca's avatar
Patrick Barroca committed
  /** @test */
  public function pageShouldBeHTML5() {
    $this->assertHTML5();
  }
Patrick Barroca's avatar
Patrick Barroca committed
  /** @test */
  public function pageShouldContainsSelectTypeDoc() {
    $this->assertXPath('//select[@name="type_doc"]');
  }
Patrick Barroca's avatar
Patrick Barroca committed
  /** @test */
  public function configAdminShouldHaveAction1SaisieInUrl() {
    $this->assertXPath('//div[@class="configuration_module"]//img[contains(@onclick, "action1=saisie")]');
  }