Commit 3a2d07a6 authored by Ghislain Loas's avatar Ghislain Loas

Merge remote-tracking branch 'refs/remotes/origin/master' into…

Merge remote-tracking branch 'refs/remotes/origin/master' into origin-dev#64573_templates_pour_l_interface_publique_libraire_bootstrap

Conflicts:
	library/Class/NoticeUnimarc.php
parents 229c8ad8 8a55bb96
Pipeline #6386 failed with stage
in 29 minutes and 40 seconds
18/02/2019 - v8.0.3
- ticket #34523 : Cosmogramme : Import de toutes les classifications définies dans les notices Unimarc
- ticket #86808 : Administration : amélioration de la suppression des albums.
- ticket gitlab#2 : Installation : correction de l'écran de mise à jour de la base de données
- ticket #86175 : Intégration Cosmogramme : correction de l'import des genres.
- ticket #85003 : Administration : amélioration de la gestion de l'éditeur de CSS.
07/02/2019 - v8.0.2
- ticket #86474 : Compte lecteur : Correction de la compatibilité du multi-carte avec l'authentification par le SIGB uniquement
05/02/2019 - v8.0.1
- ticket #86381 : SIGB Nanook : Correction de l'authentification par SIGB uniquement
04/02/2019 - v8.0.0
- ticket #86010 : Administration : activation des fonctionnalités de la version 8.0 .
......
......@@ -50,11 +50,15 @@ smalltalk.addMethod(
"_cssUrl",
smalltalk.method({
selector: "cssUrl",
fn: function (){
fn: function(){
var self=this;
return (($receiver = self['@cssUrl']) == nil || $receiver == undefined) ? (function(){var linkTag=nil;
(linkTag=smalltalk.send((typeof window == 'undefined' ? nil : window), "_jQuery_", [unescape("%23profil_css")]));(self['@cssUrl']=smalltalk.send(linkTag, "_attr_", ["href"]));smalltalk.send(linkTag, "_remove", []);return self['@cssUrl'];})() : $receiver;
return self;}
var linkTag;
linkTag=smalltalk.send(window,"_jQuery_",["#profil_css"]);
self["@cssUrl"]=smalltalk.send(linkTag,"_attr_",["data-url"]);
self["@cssUrl"]=smalltalk.send(self["@cssUrl"],"__comma",["?"]);
self["@cssUrl"]=smalltalk.send(self["@cssUrl"],"__comma",[smalltalk.send(smalltalk.send((smalltalk.Date || Date),"_now",[]),"_asMilliseconds",[])]);
return self["@cssUrl"];
}
}),
smalltalk.AFICssEditor);
......@@ -73,10 +77,22 @@ smalltalk.addMethod(
"_loadCss",
smalltalk.method({
selector: "loadCss",
fn: function (){
fn: function(){
var self=this;
(($receiver = smalltalk.send(self, "_cssUrl", [])) != nil && $receiver != undefined) ? (function(){return (function($rec){smalltalk.send($rec, "_onSuccessDo_", [(function(data){smalltalk.send(self, "_contents_", [data]);return smalltalk.send(self, "_updateStyleTag", []);})]);return smalltalk.send($rec, "_send", []);})(smalltalk.send((smalltalk.Ajax || Ajax), "_url_", [self['@cssUrl']]));})() : nil;
return self;}
var $1,$2,$3;
$1=smalltalk.send(self,"_cssUrl",[]);
if(($receiver = $1) == nil || $receiver == undefined){
$1;
} else {
$2=smalltalk.send((smalltalk.Ajax || Ajax),"_url_",[self["@cssUrl"]]);
smalltalk.send($2,"_onSuccessDo_",[(function(data){
smalltalk.send(self,"_contents_",[data]);
return smalltalk.send(self,"_updateStyleTag",[]);
})]);
$3=smalltalk.send($2,"_send",[]);
$3;
};
return self}
}),
smalltalk.AFICssEditor);
......@@ -145,10 +161,16 @@ smalltalk.addMethod(
"_close",
smalltalk.method({
selector: "close",
fn: function (){
var self=this;
(($receiver = self['@current']) != nil && $receiver != undefined) ? (function(){smalltalk.send(self['@current'], "_close", []);return (self['@current']=nil);})() : nil;
return self;}
fn: function(){
var self=this;
if(($receiver = self["@current"]) == nil || $receiver == undefined){
self["@current"];
} else {
smalltalk.send(self["@current"],"_close",[]);
self["@current"]=nil;
self["@current"];
};
return self}
}),
smalltalk.AFICssEditor.klass);
......@@ -163,31 +185,15 @@ return self;}
}),
smalltalk.AFICssEditor.klass);
smalltalk.addMethod(
"_initializeold",
smalltalk.method({
selector: "initializeold",
fn: function (){
var self=this;
smalltalk.send(smalltalk.send((smalltalk.AFIIDETools || AFIIDETools),"_default",[]),"_addButton_action_",["Editeur CSS",(function(){
smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.TabManager || TabManager),"_current",[]),"_tabs",[]),"_do_",[(function(aTab){
return smalltalk.send(smalltalk.send((smalltalk.TabManager || TabManager),"_current",[]),"_removeTab_",[aTab]);
})]);
return smalltalk.send(smalltalk.send(self,"_current",[]),"_open",[]);
})]);
return self}
}),
smalltalk.AFICssEditor.klass);
smalltalk.addMethod(
"_open",
smalltalk.method({
selector: "open",
fn: function (){
fn: function(){
var self=this;
(($receiver = self['@current']) == nil || $receiver == undefined) ? (function(){(self['@current']=smalltalk.send(self, "_new", []));return smalltalk.send(self['@current'], "_open", []);})() : $receiver;
return self['@current'];
return self;}
smalltalk.send(smalltalk.send(self,"_current",[]),"_open",[]);
return self["@current"];
}
}),
smalltalk.AFICssEditor.klass);
......
......@@ -66,15 +66,19 @@ smalltalk.addMethod(
smalltalk.method({
selector: "cssUrl",
category: 'accessor',
fn: function (){
fn: function(){
var self=this;
return (($receiver = self['@cssUrl']) == nil || $receiver == undefined) ? (function(){var linkTag=nil;
(linkTag=smalltalk.send((typeof window == 'undefined' ? nil : window), "_jQuery_", [unescape("%23profil_css")]));(self['@cssUrl']=smalltalk.send(linkTag, "_attr_", ["href"]));smalltalk.send(linkTag, "_remove", []);return self['@cssUrl'];})() : $receiver;
return self;},
var linkTag;
linkTag=smalltalk.send(window,"_jQuery_",["#profil_css"]);
self["@cssUrl"]=smalltalk.send(linkTag,"_attr_",["data-url"]);
self["@cssUrl"]=smalltalk.send(self["@cssUrl"],"__comma",["?"]);
self["@cssUrl"]=smalltalk.send(self["@cssUrl"],"__comma",[smalltalk.send(smalltalk.send((smalltalk.Date || Date),"_now",[]),"_asMilliseconds",[])]);
return self["@cssUrl"];
},
args: [],
source: "cssUrl\x0a\x09^ cssUrl ifNil: [\x09|linkTag| \x0a\x09\x09\x09\x09 \x09linkTag := (window jQuery: '#profil_css'). \x0a\x09\x09\x09\x09 \x09cssUrl := linkTag attr: 'href'.\x0a\x09\x09\x09\x09\x09linkTag remove.\x0a\x09\x09\x09\x09\x09cssUrl ]",
messageSends: ["ifNil:", "jQuery:", "attr:", "remove"],
referencedClasses: []
source: "cssUrl\x0a\x09|linkTag|\x0a\x09linkTag := (window jQuery: '#profil_css').\x0a cssUrl := linkTag attr: 'data-url'.\x09\x0a cssUrl := cssUrl, '?'.\x0a cssUrl := cssUrl, Date now asMilliseconds.\x0a ^ cssUrl.",
messageSends: ["jQuery:", "attr:", ",", "asMilliseconds", "now"],
referencedClasses: ["Date"]
}),
smalltalk.AFICssEditor);
......@@ -99,13 +103,25 @@ smalltalk.addMethod(
smalltalk.method({
selector: "loadCss",
category: 'actions',
fn: function (){
fn: function(){
var self=this;
(($receiver = smalltalk.send(self, "_cssUrl", [])) != nil && $receiver != undefined) ? (function(){return (function($rec){smalltalk.send($rec, "_onSuccessDo_", [(function(data){smalltalk.send(self, "_contents_", [data]);return smalltalk.send(self, "_updateStyleTag", []);})]);return smalltalk.send($rec, "_send", []);})(smalltalk.send((smalltalk.Ajax || Ajax), "_url_", [self['@cssUrl']]));})() : nil;
return self;},
var $1,$2,$3;
$1=smalltalk.send(self,"_cssUrl",[]);
if(($receiver = $1) == nil || $receiver == undefined){
$1;
} else {
$2=smalltalk.send((smalltalk.Ajax || Ajax),"_url_",[self["@cssUrl"]]);
smalltalk.send($2,"_onSuccessDo_",[(function(data){
smalltalk.send(self,"_contents_",[data]);
return smalltalk.send(self,"_updateStyleTag",[]);
})]);
$3=smalltalk.send($2,"_send",[]);
$3;
};
return self},
args: [],
source: "loadCss\x0a\x09self cssUrl ifNotNil: [\x09(Ajax url: cssUrl) \x0a\x09\x09\x09\x09\x09\x09onSuccessDo: [:data | \x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09self contents: data. \x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09 self updateStyleTag ];\x0a\x09\x09\x09\x09\x09\x09send. ].",
messageSends: ["ifNotNil:", "cssUrl", "onSuccessDo:", "contents:", "updateStyleTag", "send", "url:"],
messageSends: ["ifNotNil:", "onSuccessDo:", "contents:", "updateStyleTag", "url:", "send", "cssUrl"],
referencedClasses: ["Ajax"]
}),
smalltalk.AFICssEditor);
......@@ -201,12 +217,18 @@ smalltalk.addMethod(
smalltalk.method({
selector: "close",
category: 'not yet classified',
fn: function (){
fn: function(){
var self=this;
(($receiver = self['@current']) != nil && $receiver != undefined) ? (function(){smalltalk.send(self['@current'], "_close", []);return (self['@current']=nil);})() : nil;
return self;},
if(($receiver = self["@current"]) == nil || $receiver == undefined){
self["@current"];
} else {
smalltalk.send(self["@current"],"_close",[]);
self["@current"]=nil;
self["@current"];
};
return self},
args: [],
source: "close\x0a\x09current\x0a\x09\x09 ifNotNil: [\x09current close.\x0a\x09\x09\x09\x09\x09current := nil ].",
source: "close\x0a\x09current\x0a\x09\x09 ifNotNil: [ current close.\x0a\x09\x09\x09\x09\x09\x09 current := nil ].",
messageSends: ["ifNotNil:", "close"],
referencedClasses: []
}),
......@@ -228,40 +250,19 @@ referencedClasses: []
}),
smalltalk.AFICssEditor.klass);
smalltalk.addMethod(
"_initializeold",
smalltalk.method({
selector: "initializeold",
category: 'not yet classified',
fn: function (){
var self=this;
smalltalk.send(smalltalk.send((smalltalk.AFIIDETools || AFIIDETools),"_default",[]),"_addButton_action_",["Editeur CSS",(function(){
smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.TabManager || TabManager),"_current",[]),"_tabs",[]),"_do_",[(function(aTab){
return smalltalk.send(smalltalk.send((smalltalk.TabManager || TabManager),"_current",[]),"_removeTab_",[aTab]);
})]);
return smalltalk.send(smalltalk.send(self,"_current",[]),"_open",[]);
})]);
return self},
args: [],
source: "initializeold\x0a\x09AFIIDETools default addButton: 'Editeur CSS' action: [\x0a\x09\x09\x09TabManager current tabs do: [:aTab| TabManager current removeTab: aTab].\x0a\x09\x09\x09self current open].",
messageSends: ["addButton:action:", "do:", "removeTab:", "current", "tabs", "open", "default"],
referencedClasses: ["TabManager", "AFIIDETools"]
}),
smalltalk.AFICssEditor.klass);
smalltalk.addMethod(
"_open",
smalltalk.method({
selector: "open",
category: 'not yet classified',
fn: function (){
fn: function(){
var self=this;
(($receiver = self['@current']) == nil || $receiver == undefined) ? (function(){(self['@current']=smalltalk.send(self, "_new", []));return smalltalk.send(self['@current'], "_open", []);})() : $receiver;
return self['@current'];
return self;},
smalltalk.send(smalltalk.send(self,"_current",[]),"_open",[]);
return self["@current"];
},
args: [],
source: "open\x0a\x09current\x0a\x09\x09 ifNil: [\x09current := self new.\x0a\x09\x09\x09\x09current open ].\x0a\x09^ current",
messageSends: ["ifNil:", "new", "open"],
source: "open\x0a\x09self current open.\x0a\x09^ current",
messageSends: ["open", "current"],
referencedClasses: []
}),
smalltalk.AFICssEditor.klass);
......
......@@ -14,11 +14,12 @@ contents: aString
!
cssUrl
^ cssUrl ifNil: [ |linkTag|
linkTag := (window jQuery: '#profil_css').
cssUrl := linkTag attr: 'href'.
linkTag remove.
cssUrl ]
|linkTag|
linkTag := (window jQuery: '#profil_css').
cssUrl := linkTag attr: 'data-url'.
cssUrl := cssUrl, '?'.
cssUrl := cssUrl, Date now asMilliseconds.
^ cssUrl.
!
label
......@@ -91,24 +92,16 @@ AFICssEditor class instanceVariableNames: 'current'!
close
current
ifNotNil: [ current close.
current := nil ].
ifNotNil: [ current close.
current := nil ].
!
current
^current ifNil: [current := self new]
!
initializeold
AFIIDETools default addButton: 'Editeur CSS' action: [
TabManager current tabs do: [:aTab| TabManager current removeTab: aTab].
self current open].
!
open
current
ifNil: [ current := self new.
current open ].
self current open.
^ current
! !
......
......@@ -61,11 +61,12 @@ class AbonneController extends ZendAfi_Controller_Action {
protected function clearEmprunteurCache() {
if (in_array($this->getRequest()->getActionName(), ['prets',
'reservations',
'fiche',
'loans-history']))
Class_WebService_SIGB_EmprunteurCache::newInstance()->remove($this->_user);
if (!in_array($this->getRequest()->getActionName(),
['prets', 'reservations', 'fiche', 'loans-history']))
return;
foreach((new Class_User_Cards($this->_user)) as $user)
Class_WebService_SIGB_EmprunteurCache::newInstance()->remove($user);
}
......@@ -1224,14 +1225,13 @@ class AbonneController extends ZendAfi_Controller_Action {
$this->view->form = $form;
if (!$this->_request->isPost() || !$form->isValid($this->_request->getPost()))
return $this;
if ((!$child = Class_Users::findFirstBy(['login' => $this->_getPost('login'),
'password' => $this->_getPost('password')]))
|| !$child->isAbonne()) {
$child = Class_Auth::getInstance()
->authenticateLoginPassword($this->_getPost('login'), $this->_getPost('password'));
if (!$child || !$child->isAbonne()) {
$this->_helper->notify($this->_('Identifiant et/ou mot de passe incorrect'));
return $this->_redirect('/abonne/add-card');
}
......
......@@ -61,14 +61,17 @@
if ($this->header_css && ($current_profil->getUseParentCss() || !$current_profil->hasParentProfil()) && !$current_profil->hasPageCss())
$head_scripts->addStyleSheet($this->header_css, ['id' => 'profil_css',
'data-url' => $current_profil->getHeaderCss(),
'media' => 'all']);
if ($this->header_css && $current_profil->getUseParentCss() && $current_profil->hasPageCss())
$head_scripts->addStyleSheet($this->header_css);
if($current_profil->hasPageCss())
$head_scripts->addStyleSheet($current_profil->getPageCss(), ['id' => 'profil_css',
'media' => 'all']);
$head_scripts->addStyleSheet($current_profil->getPageCss(),
['id' => 'profil_css',
'data-url' => $current_profil->getPageCss(),
'media' => 'all']);
if ($this->accessibilite_on) {
//Feuilles de styles pour les déficiences visuelles
......
......@@ -20,9 +20,7 @@
*/
class DatabaseMigrationController extends ZendAfi_Controller_Action {
class Cosmo_DatabaseMigrationController extends ZendAfi_Controller_Action {
public function preDispatch() {
parent::preDispatch();
$this->getHelper('ViewRenderer')->setNoRender();
......
......@@ -58,6 +58,7 @@ $script_loader = Class_ScriptLoader::getInstance();
?>
</head>
<body class="droite">
<?php echo $this->helpLink($this->action); ?>
<?php echo $html; ?>
</body>
</html>
......@@ -46,6 +46,7 @@ abstract class CosmoControllerTestCase extends Zend_Test_PHPUnit_ControllerTestC
Storm_Model_Abstract::unsetLoaders();
Class_FileManager::reset();
Class_FileManager_FileSystem::reset();
Class_Cosmogramme_LandingDirectory::reset();
}
......
......@@ -19,7 +19,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
abstract class MigrateControllerTestCase extends AbstractControllerTestCase {
require_once 'MigrationFixture.php';
abstract class MigrateControllerTestCase extends CosmoControllerTestCase {
public function setUp() {
parent::setUp();
Storm_Model_Loader::defaultToVolatile();
......@@ -38,7 +41,7 @@ class MigrateControllerPhpDisplayTest extends MigrateControllerTestCase{
public function setUp() {
parent::setUp();
MigrationFixture::mockFileSystemWithPhpScripts();
$this->dispatch('/database-migration/migrate', true);
$this->dispatch('/cosmo/database-migration/migrate', true);
}
......@@ -64,7 +67,7 @@ class MigrateControllerPhpDisplayTest extends MigrateControllerTestCase{
/** @test */
public function migrationforceLinkShouldContainSkipPhp() {
$this->assertXPath('//a[contains(@href, "/database-migration/migrate/skip_php/1")]',
$this->assertXPath('//a[contains(@href, "/cosmo/database-migration/migrate/skip_php/1")]',
$this->_response->getBody());
}
......@@ -83,7 +86,7 @@ class MigrateControllerSqlDisplayTest extends MigrateControllerTestCase{
public function setUp() {
parent::setUp();
MigrationFixture::mockFileSystemWithSql();
$this->dispatch('/database-migration/migrate', true);
$this->dispatch('/cosmo/database-migration/migrate', true);
}
......@@ -109,7 +112,7 @@ class MigrateControllerSqlDisplayTest extends MigrateControllerTestCase{
/** @test */
public function migrationforceLinkShouldContainReprise() {
$this->assertXPath('//a[contains(@href, "/database-migration/migrate/reprise/1")]',
$this->assertXPath('//a[contains(@href, "/cosmo/database-migration/migrate/reprise/1")]',
$this->_response->getBody());
}
......@@ -128,7 +131,7 @@ class MigrateControllerForcePhpTest extends MigrateControllerTestCase{
public function setUp() {
parent::setUp();
MigrationFixture::mockFileSystemWithPhpScripts();
$this->dispatch('/database-migration/migrate/skip_php/1', true);
$this->dispatch('/cosmo/database-migration/migrate/skip_php/1', true);
}
......@@ -147,13 +150,13 @@ class MigrateControllerForceSqlTest extends MigrateControllerTestCase{
public function setUp() {
parent::setUp();
MigrationFixture::mockFileSystemWithSql();
$this->dispatch('/database-migration/migrate/reprise/12', true);
$this->dispatch('/cosmo/database-migration/migrate/reprise/12', true);
}
/** @test */
public function migrationShouldStopOnPatch13() {
$this->assertXPath('//a[contains(@href, "/database-migration/migrate/reprise/13")]');
$this->assertXPath('//a[contains(@href, "/cosmo/database-migration/migrate/reprise/13")]');
}
......@@ -171,4 +174,3 @@ class MigrateControllerForceSqlTest extends MigrateControllerTestCase{
}
}
?>
\ No newline at end of file
......@@ -110,6 +110,18 @@ class Cosmo_DynamicFacetsControllerAddTest extends CosmoControllerTestCase {
}
/** @test */
public function pageShouldContainsSelectForFilterField() {
$this->assertXPath('//select[@name="rule_filter_field"]');
}
/** @test */
public function pageShouldContainsInputForFilterValue() {
$this->assertXPath('//input[@name="rule_filter_value"]');
}
/** @test */
public function labelForBokehShouldBePresent() {
$this->assertXPath('//input[@name="libelle_facette"][@value="** nouvelle facette dynamique **"]');
......@@ -141,7 +153,9 @@ class Cosmo_DynamicFacetsControllerAddPostValidTest extends CosmoControllerTestC
'rule_label_field' => 'a',
'rule_id_field' => '9',
'rule_label_start_pos' => '2',
'rule_label_length' => '4']);
'rule_label_length' => '4',
'rule_filter_field' => 't',
'rule_filter_value' => 'Take me']);
Class_CodifThesaurus::clearCache();
$this->model = Class_CodifThesaurus::findFirstBy(['libelle' => 'New facet name']);
......@@ -188,6 +202,18 @@ class Cosmo_DynamicFacetsControllerAddPostValidTest extends CosmoControllerTestC
public function rulesLabelLengthShouldBeFour() {
$this->assertEquals('4', $this->model->getRulesAsArray()['rule_label_length']);
}
/** @test */
public function ruleFilterFieldShouldBeT() {
$this->assertEquals('t', $this->model->getRulesAsArray()['rule_filter_field']);
}
/** @test */
public function ruleFilterValueShouldBeTakeMe() {
$this->assertEquals('Take me', $this->model->getRulesAsArray()['rule_filter_value']);
}
}
......
......@@ -619,45 +619,90 @@ abstract class Cosmo_IntegrationControllerWaitingFilesTestCase extends CosmoCont
'nom_fichier' => 'lunel/[DATE]_records_tot.mrc',
'taille_min_import_total' => 0]);
$lunel = $this->mock()->whenCalled('getPath')
->answers('/ccpl34/lunel')
->whenCalled('getName')->answers('lunel');
$this->_tot = $this->mock()
->whenCalled('getParent')->answers($lunel)
->whenCalled('isWritable')->answers(true)
->whenCalled('getName')->answers('20190116220001_records_tot.mrc')
->whenCalled('getMTime')->answers('2019-01-13 22:88:77')
->whenCalled('getSize')->answers('42 Ko')
->whenCalled('getFileSize')->answers(43986)
->whenCalled('getId')->answers('/ccpl34/lunel/20190116220001_records_tot.mrc')
->whenCalled('getModels')->answers([])
->whenCalled('isDir')->answers(false)
->whenCalled('getPath')->answers('/ccpl34/lunel/')
->whenCalled('readfile')->answers(true)
->whenCalled('getProgrammed')->answers(Class_IntMajAuto::find(43))
;
$ccpl34 = $this
->mock()
->whenCalled('isDir')->answers(true)
->whenCalled('getPath')->answers('/ccpl34')
->whenCalled('getName')->answers('ccpl34');
$lunel = $this
->mock()
->whenCalled('isDir')->answers(true)
->whenCalled('getPath')->answers('/ccpl34/lunel')
->whenCalled('getName')->answers('lunel')
->whenCalled('getParent')->answers($ccpl34);
$etalon = $this
->mock()
->whenCalled('isDir')->answers(true)
->whenCalled('getPath')->answers('/ccpl34/etalon')
->whenCalled('getName')->answers('etalon')
->whenCalled('getParent')->answers($ccpl34);
$kinds = $this
->mock()
->whenCalled('getName')->answers('genres.txt')
->whenCalled('getMTime')->answers('2019-01-13 22:88:77')
->whenCalled('getFileSize')->answers(43986)
->whenCalled('getParent')->answers($etalon)
->whenCalled('getPath')->answers('/ccpl34/etalon/genres.txt')
->whenCalled('getFileMTime')->answers('12345678')
->whenCalled('getProgrammed')->answers(null)
->whenCalled('isWritable')->answers(true)
->whenCalled('getId')->answers('/ccpl34/etalon/genres.txt')
->whenCalled('getParentPath')->answers('/ccpl34/etalon')
->whenCalled('isFile')->answers(true);
$this->_tot = $this
->mock()
->whenCalled('getParent')->answers($lunel)
->whenCalled('isWritable')->answers(true)
->whenCalled('getName')->answers('20190116220001_records_tot.mrc')
->whenCalled('getMTime')->answers('2019-01-13 22:88:77')
->whenCalled('getFileMTime')->answers('1234567')
->whenCalled('getSize')->answers('42 Ko')
->whenCalled('getFileSize')->answers(43986)
->whenCalled('getId')->answers('/ccpl34/lunel/20190116220001_records_tot.mrc')
->whenCalled('getModels')->answers([])
->whenCalled('isDir')->answers(false)
->whenCalled('getPath')->answers('/ccpl34/lunel/20190116220001_records_tot.mrc')
->whenCalled('getParentPath')->answers('/ccpl34/lunel')
->whenCalled('readfile')->answers(true)
->whenCalled('getProgrammed')->answers(Class_IntMajAuto::find(43))
->whenCalled('isFile')->answers(true);
$this->_tot->whenCalled('setProgrammed')->answers($this->_tot);
$file_system = $this
->mock()
->whenCalled('directoriesAt')->with('/ccpl34')->answers([$lunel])
->whenCalled('search')->with('*', '/ccpl34/lunel')->answers([$this->_tot])
->whenCalled('search')->with('*', '/ccpl34/etalon')->answers([$kinds])
->whenCalled('directoriesAt')->with('/ccpl34')->answers([$lunel, $etalon])
->whenCalled('directoryAt')->with('ccpl34/lunel')->answers($lunel)
->whenCalled('directoryAt')->with('ccpl34/etalon')->answers($etalon)
->whenCalled('filesAt')->with('/ccpl34/lunel')->answers([$this->_tot])
->whenCalled('fileAt')->with('ccpl34/lunel')->answers(null)
->whenCalled('fileAt')->with('ccpl34/etalon')->answers(null)
->whenCalled('delete')->with('/ccpl34/lunel/20190116220001_records_tot.mrc')
->answers(true)
->whenCalled('directoryAt')->with('ccpl34/lunel/20190116220001_records_tot.mrc')
->answers(null)
->whenCalled('fileAt')->with('ccpl34/lunel/20190116220001_records_tot.mrc')
->answers($this->_tot)
->answers($this->_tot);
->whenCalled('delete')->with('/ccpl34/lunel/20190116220001_records_tot.mrc')
->answers(true)
;
Class_FileManager::setFileSystem($file_system);
Class_Cosmogramme_LandingDirectory::setSubdirCache($etalon);
Class_AdminVar::set('NOM_DOMAINE', 'http://localhost');
}
}
......@@ -700,6 +745,12 @@ class Cosmo_IntegrationControllerWaitingFilesActionTest
public function linkToDownloadRecordTotShouldBePresent() {
$this->assertXPath('//a[@href = "/cosmo/integration/waiting-files-download?id=%2Fccpl34%2Flunel%2F20190116220001_records_tot.mrc"]');
}
/** @test */
public function kindsShouldBeProgrammed() {
$this->assertXPathContentContains('//tr[@data-path="/ccpl34/etalon/genres.txt"]//td', 'Programmé');
}
}