Skip to content
Snippets Groups Projects
Commit 526828c1 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Fix #12252 : regression in website library indexing

parent fa0cc63a
Branches
Tags
No related merge requests found
......@@ -416,7 +416,7 @@ class Class_Indexation_PseudoNotice_Rss extends Class_Indexation_PseudoNotice{
class Class_Indexation_PseudoNotice_Sito extends Class_Indexation_PseudoNotice{
protected $_ = 'Class_Sitotheque';
protected $_model_name = 'Class_Sitotheque';
protected $_id = 'ID_SITO';
protected $_label='m3';
}
......@@ -428,4 +428,4 @@ class Class_Indexation_PseudoNotice_Null extends Class_Indexation_PseudoNotice{
public function isValid() {
return false;
}
}
}
\ No newline at end of file
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 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).
*
* AFI-OPAC 2.0 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 AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
abstract class Class_Indexation_PseudoNoticeTestCase extends Storm_Test_ModelTestCase {
public function setUp() {
parent::setUp();
Class_Notice::beVolatile();
}
}
class Class_Indexation_PseudoNoticeSitothequeTest extends Class_Indexation_PseudoNoticeTestCase {
protected $_sito;
protected $_notice;
public function setUp() {
parent::setUp();
$this->_sito = $this->fixture('Class_Sitotheque', ['id' => 12,
'titre' => 'Thot cursus',
'url' => 'http://cursus.edu/',
'description' => 'Top notch site',
'tags' => 'VOD']);
Class_Indexation_PseudoNotice::newWith(Class_Indexation_PseudoNotice::TYPE_SITO,
$this->_sito->toArray() + ['ID_SITO' => $this->_sito->getId()])
->save();
$this->_notice = $this->_sito->getNotice();
}
/** @test */
public function shouldIndex() {
$this->assertNotNull($this->_notice);
}
/** @test */
public function titleShouldBeIndexed() {
$this->assertEquals('Thot cursus', $this->_notice->getTitrePrincipal());
}
/** @test */
public function typeShouldBeSite() {
$this->assertEquals(Class_Indexation_PseudoNotice::TYPE_SITO,
$this->_notice->getTypeDoc());
}
}
\ No newline at end of file
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