Newer
Older
<?php
/**
* Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved.
*
* 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).
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

Patrick Barroca
committed
class Cosmo_IntegrationControllerTestActionTest extends CosmoControllerTestCase {
protected $_service;
public function setUp() {
parent::setUp();
$this->_service = $this->mock()->whenCalled('test')->answers('');
Class_WebService_SIGB_Nanook::setService(['url_serveur' => 'http://localhost/ilsdi'],
$this->_service);
}
public function tearDown() {
Class_WebService_SIGB_Nanook::reset();
parent::tearDown();
}
public function shouldHaveCalledServiceTestMethod() {
$this->dispatch('/cosmo/integration/test?type=7&options[url_serveur]=' . urlencode('http://localhost/ilsdi'), true);
$this->assertTrue($this->_service->methodHasBeenCalled('test'));

Patrick Barroca
committed
abstract class Cosmo_IntegrationControllerControlActionTestCase extends CosmoControllerTestCase {
public function setUp() {
parent::setUp();
$this->fixture('Class_CosmoVar',
['id' => 'import_type_operation',
'liste' => "0:Import incrémentiel\r\n1:Suppression d'exemplaires\r\n2:Import total\r\n3:Suppression fichier d'entête Pergame\r\n"]);
$this->fixture('Class_CosmoVar',
['id' => 'type_fichier',
'liste' => "0:notices\r\n1:abonnés\r\n2:prêts\r\n3:reservations\r\n4:paniers\r\n"]);

Patrick Barroca
committed
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
$this->file_system = $this->mock();
Class_Cosmogramme_Integration::setFileSystem($this->file_system);
}
}
class Cosmo_IntegrationControllerControlActionWithoutBibTest extends Cosmo_IntegrationControllerControlActionTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/cosmo/integration/control/id/99', true);
}
/** @test */
public function libraryShouldBeUnknown() {
$this->assertXPathContentContains('//div[@class="message_grand"]',
'Bibliothèque inconnue');
}
/** @test */
public function shouldNotHavePlanif() {
$this->assertXPathContentContains('//h3', 'Plannification : Aucune');
}
/** @test */
public function shouldNotHaveFiles() {
$this->assertXPathContentContains('//h3', 'Cette bibliothèque n\'a jamais été intégrée.');
}
}
class Cosmo_IntegrationControllerControlActionWithBibTest extends Cosmo_IntegrationControllerControlActionTestCase {
public function setUp() {
parent::setUp();
$this->file_system
->whenCalled('file_exists')->answers(true)
->whenCalled('filesize')->answers(1024)
;
$profil = $this->fixture('Class_IntProfilDonnees',

Patrick Barroca
committed
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
['id' => 1,
'type_fichier' => 1]);
$integration = $this->fixture('Class_Cosmogramme_Integration',
['id' => 29,
'traite' => 'non',
'date_transfert' => '2014-11-14',
'type_operation' => 2,
'fichier' => 'integre0000.pan',
'pointeur_reprise' => 0,
'nb_erreurs' => 0,
'nb_warnings' => 0,
'profil_donnees' => $profil]);
$this->fixture('Class_IntBib',
['id' => 19,
'nom_court' => 'Testing library',
'planif_mode' => 'r',
'planif_jours' => '0010011',
'integrations' => [$integration]]);
$this->dispatch('/cosmo/integration/control/id/19', true);
}
/** @test */
public function libraryShouldBePresent() {
$this->assertXPathContentContains('//div[@class="message_grand"]',
'Testing library');
}
/** @test */
public function shouldHavePlanif() {
$this->assertXPathContentContains('//h3', 'Plannification : Me, Sa, Di');
}
/** @test */
public function shouldHaveFiles() {
$this->assertXPath('//table');
}
/** @test */
public function integre0000ShouldBePresent() {
$this->assertXPathContentContains('//td', 'integre0000.pan');
}
/** @test */
public function abonneShouldBePresent() {
$this->assertXPathContentContains('//td', 'abonnés');
}
/** @test */
public function importTotalShouldBePresent() {
$this->assertXPathContentContains('//td', 'Import total');
}
/** @test */
public function downloadLinkShouldBePresent() {
$this->assertXPath('//a[contains(@href, "run-log/download/id/29")]');
}
/** @test */
public function vendrediShouldBePresent() {
$this->assertXPathContentContains('//td', 'vendredi');
}
}
abstract class Cosmo_IntegrationControllerGenerateActionTestCase extends CosmoControllerTestCase {
public function setUp() {
parent::setUp();
$this->fixture('Class_CosmoVar',
['id' => 'ftp_path',
'valeur' => '../ftp/transfert/']);
$subdir_calls = 0;
$subdir_provider = function() use (&$subdir_calls) {
$subdir_calls++;
$mapping = [1 => '.', 2 => '..', 3 => 'library', 4 => 'test'];
return array_key_exists($subdir_calls, $mapping) ? $mapping[$subdir_calls] : false;
};
$file_system = $this->mock()
->whenCalled('file_exists')->with('../ftp/transfert/')
->answers(true)
->whenCalled('opendir')->with('../ftp/transfert/')
->answers(true)
->whenCalled('readdir')->with(true)
->willDo($subdir_provider)
->whenCalled('is_dir')->with('../ftp/transfert/library')
->answers(true)
->whenCalled('is_readable')
->with('../ftp/transfert/library/etalon')
->answers(true)
->whenCalled('is_readable')
->with('../ftp/transfert/library/etalon/annexes.txt')
->answers(true)
->whenCalled('is_readable')
->with('../ftp/transfert/library/etalon/genres.txt')
->answers(true)
->whenCalled('is_readable')
->with('../ftp/transfert/library/etalon/sections.txt')
->answers(true)
->whenCalled('is_readable')
->with('../ftp/transfert/library/etalon/emplacements.txt')
->answers(true)
->whenCalled('file')
->with('../ftp/transfert/library/etalon/annexes.txt')
->answers(['BIB_SPS_UTT|ID_SITE|LIBELLE',
'20|library1',
'12|library2'])
->whenCalled('file')
->with('../ftp/transfert/library/etalon/sections.txt')
->answers(['BIB_C_SECTION|CODE|LIBELLE',
'1|Adulte',
'2|Jeunesse'])
->whenCalled('file')
->with('../ftp/transfert/library/etalon/emplacements.txt')
->answers(['BIB_C_EMPLACEMENT|CODE|LIBELLE',
'4|Coin des tout-petits',
'5|Livres CD',
'6|Bacs imagiers',
'7|Albums'])
->whenCalled('file')
->with('../ftp/transfert/library/etalon/genres.txt')
->answers(['BIB_GENRES|SUPPORT|CODE|LIBELLE|DOC',
'0|1|Album|f',
'0|2|Bande dessinée|f',
'0|3|Biographie|f'])
->beStrict();
Class_Cosmogramme_LandingDirectory::setFileSystem($file_system);
}
public function tearDown() {
Class_Log::getInstance()->reset();
parent::tearDown();
}
}
class Cosmo_IntegrationControllerGenerateActionTest extends Cosmo_IntegrationControllerGenerateActionTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('cosmo/integration/generate', true);
}
public function tearDown() {
Class_Cosmogramme_LandingDirectory::setFileSystem(null);
parent::tearDown();
}
/** @test */
public function titleShouldBeGenerationAutomatique() {
$this->assertXPathContentContains('//h1', 'Génération automatique');
}
/** @test */
public function library1ShouldBeSelectable() {

Patrick Barroca
committed
$this->assertXPath('//select[@name="path_ftp"]//option[@value="library"]');
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
}
/** @test */
public function testShouldNotBeSelectable() {
$this->assertNotXPath('//select[@name="path_ftp"]//option[@value="test"]');
}
/** @test */
public function parentShouldNotBeSelectable() {
$this->assertNotXPath('//select[@name="path_ftp"]//option[@value=".."]');
}
/** @test */
public function sigbNanookShouldBeSelectable() {
$this->assertXPath('//select[@name="type_sigb"]//option[@value="13"]');
}
/** @test */
public function shouldBeAbleToChooseBranchCreationMode() {
$this->assertXPath('//select[@name="creer_annexes"]');
}
}
class Cosmo_IntegrationControllerGenerateActionNanookPostTest
extends Cosmo_IntegrationControllerGenerateActionTestCase {
public function setUp() {
parent::setUp();
$this->fixture('Class_IntProfilDonnees',
['id' => 104,
'libelle' => 'Unimarc Nanook',
'type_fichier' => 0]);
$this->fixture('Class_IntProfilDonnees',
['id' => 105,
'libelle' => 'Abonné Nanook',
'type_fichier' => 1]);

Patrick Barroca
committed
$this->_setupExistingDeletedBib();
$time_source = $this->mock()->whenCalled('time')->answers(strtotime('2016-01-28'));
Class_Cosmogramme_Generator::setTimeSource($time_source);
Class_Cosmogramme_Generator_AbstractTask::setTimeSource($time_source);
$this->postDispatch('cosmo/integration/generate',
['path_ftp' => 'library',
'type_sigb' => 13,
'service_nanook' => 'http://nanook-ws.net/ilsdi/',
'creer_annexes' => 1,
'synchro' => 1]);
}

Patrick Barroca
committed
protected function _setupExistingDeletedBib() {
$lib = $this->fixture('Class_IntBib',

Patrick Barroca
committed
'nom' => 'Existing deleted',
'nom_court' => 'Deleted',
'qualite' => 5,
'sigb' => Class_IntBib::SIGB_NANOOK,
'planif_mode' => 'r',
'planif_jours' => '1111111',
'comm_sigb' => Class_IntBib::COM_NANOOK]);
$this->fixture('Class_IntMajAuto',
['id_bib' => 20,
'profil' => 103,
'type_operation' => Class_IntMajAuto::OP_FULL_IMPORT,
'nom_fichier' => 'library/site6/reservations.txt']);
}
public function tearDown() {
Class_Cosmogramme_Generator::setTimeSource(null);
Class_Cosmogramme_Generator_AbstractTask::setTimeSource(null);
parent::tearDown();
}
/** @test */
public function shouldNotContainsForm() {
$this->assertNotXPath('//form');
}
/** @test */
public function shouldNotHaveError() {
$this->assertNotXPath('//font[@color="red"]', $this->_response->getBody());
}
/** @test */
public function shouldLogLibraryCreation() {
$this->assertXPathContentContains('//h3', '1 - Création des bibliothèques', $this->_response->getBody());
}
/** @test */
public function shouldHaveCreated2Libraries() {

Patrick Barroca
committed
$this->assertEquals(2, Class_Cosmogramme_Generator_FixedIdBib::count());
}

Patrick Barroca
committed
/** @test */
public function shouldHaveDisabledExistingDeletedLibrary() {
$this->assertTrue(Class_IntBib::find(6)->isDisconnected());
}
/** @test */
public function shouldHaveDeletedExistingDeletedPlannedIntegrations() {
$this->assertEmpty(Class_IntMajAuto::findAllBy(['id_bib' => 6]));
}
/** @test */
public function library1ShouldBeCreated() {

Patrick Barroca
committed
$this->assertNotNull(Class_Cosmogramme_Generator_FixedIdBib::findFirstBy(['id_site' => 20,
'libelle' => 'library1',
'ville' => 'library',
'id_zone' => 1,
'visibilite' => Class_Bib::V_DATA]));
}
/** @test */
public function library1IntegrationShouldBeCreated() {
$this->assertNotNull($bib = Class_IntBib::findFirstBy(['id_bib' => 20,
'nom' => 'library1',
'qualite' => 5,
'sigb' => Class_IntBib::SIGB_NANOOK,
'planif_mode' => 'r',
'planif_jours' => '1111111',
'comm_sigb' => Class_IntBib::COM_NANOOK
]));
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
return $bib;
}
/**
* @test
* @depends library1IntegrationShouldBeCreated
*/
public function library1IntegrationCommParamsShouldContainsNanookWebservice($bib) {
$this->assertContains('http://nanook-ws.net/ilsdi/', $bib->getCommParams());
}
/** @test */
public function library1BranchShouldBeCreated() {
$this->assertNotNull(Class_CodifAnnexe::findFirstBy(['id_bib' => 20,
'code' => 20,
'libelle' => 'library1',
'invisible' => 0]),
$this->_response->getBody());
}
/** @test */
public function barCodeProfileShouldBeCreated() {
$this->assertNotNull($profile = Class_IntProfilDonnees::findFirstBy(['libelle' => 'Liste de codes-barres']));
return $profile;
}
/**
* @test
* @depends barCodeProfileShouldBeCreated
*/
public function library1ShouldHeveItemDeletionPlanned($profile) {
$this->assertNotNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20,
'profil' => $profile->getId(),
'type_operation' => Class_IntMajAuto::OP_ITEMS_DELETION,
'nom_fichier' => 'library/site20/suppressions.txt']));
}
/** @test */
public function library1ShouldHaveRecordsTotalPlanned() {
$this->assertNotNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20,
'profil' => 104,
'type_operation' => Class_IntMajAuto::OP_FULL_IMPORT,
'nom_fichier' => 'library/site20/notices_total.txt']));
}
/** @test */
public function library1ShouldHaveRecordsPartialPlanned() {
$this->assertNotNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20,
'profil' => 104,
'type_operation' => Class_IntMajAuto::OP_PARTIAL_IMPORT,
'nom_fichier' => 'library/site20/notices.txt']));
}
/** @test */
public function library1ShouldHaveUsersPlanned() {
$this->assertNotNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20,
'profil' => 105,
'type_operation' => Class_IntMajAuto::OP_FULL_IMPORT,
'nom_fichier' => 'library/site20/abonnes.txt']));
}
/** @test */
public function library1ShouldHaveLoansPlanned() {
$this->assertNotNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20,
'profil' => 102,
'type_operation' => Class_IntMajAuto::OP_FULL_IMPORT,
'nom_fichier' => 'library/site20/prets.txt']));
}
/** @test */
public function library1ShouldNotHaveHoldsPlanned() {
$this->assertNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20,
'profil' => 103,
'type_operation' => Class_IntMajAuto::OP_FULL_IMPORT,
'nom_fichier' => 'library/site20/reservations.txt']));
}
/** @test */
public function basketsProfileShouldBeCreated() {
$profile = Class_IntProfilDonnees::findFirstBy(['accents' => Class_IntProfilDonnees::ENCODING_UTF8,
'type_fichier' => Class_IntProfilDonnees::FT_BASKETS,
'format' => Class_IntProfilDonnees::FORMAT_PIPED_ASCII]);
$this->assertNotNull($profile);
return $profile;
}
/**
* @test
* @depends basketsProfileShouldBeCreated
*/
public function library1ShouldHaveBasketsFullPlanned($profile) {
$this->assertNotNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20,
'profil' => $profile->getId(),
'type_operation' => Class_IntMajAuto::OP_FULL_IMPORT,
'nom_fichier' => 'library/site20/paniers_total.txt']));
}
/**
* @test
* @depends basketsProfileShouldBeCreated
*/
public function library1ShouldHaveBasketsPartialPlanned($profile) {
$this->assertNotNull(Class_IntMajAuto::findFirstBy(['id_bib' => 20,
'profil' => $profile->getId(),
'type_operation' => Class_IntMajAuto::OP_PARTIAL_IMPORT,
'nom_fichier' => 'library/site20/paniers.txt']));
}
/** @test */
public function adulteSectionShouldBeCreated() {
$this->assertNotNull(Class_CodifSection::findFirstBy(['libelle' => 'Adulte',
'regles' => '995$9=1']));
}
/** @test */
public function coinLocationShouldBeCreated() {
$this->assertNotNull(Class_CodifEmplacement::findFirstBy(['libelle' => 'Coin des tout-petits',
'regles' => '995$6=4']));
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
/** @test */
public function bdKindShouldBeCReated() {
$this->assertNotNull(Class_CodifGenre::findFirstBy(['libelle' => 'Biographie',
'regles' => '995$7=3']));
}
/** @test */
public function shouldHaveCreated10Deweys() {
$this->assertEquals(10, Class_CodifDewey::count());
}
/** @test */
public function generaliteDeweyShouldHaveId0() {
$this->assertNotNull(Class_CodifDewey::findFirstBy(['id_dewey' => 0, 'libelle' => 'Généralités']));
}
/** @test */
public function histoireDeweyShouldHaveId9() {
$this->assertNotNull(Class_CodifDewey::findFirstBy(['id_dewey' => 9, 'libelle' => 'Histoire, géographie']));
}
/** @test */
public function shouldSayFinished() {
$this->assertXPathContentContains('//h2', 'Traitement terminé');
}
}
abstract class Cosmo_IntegrationControllerWaitingFilesTestCase extends CosmoControllerTestCase {
protected $_tot;
public function setUp() {
parent::setUp();
Class_CosmoVar::set('ftp_path', '/ccpl34');
$this->fixture('Class_IntMajAuto',
['id' => 43,
'int_bib' => $this->fixture('Class_IntBib',
['id' => 1,
'nom_court' => 'Lunel']),
'libelle' => 'total',
'profil_donnees' => $this->fixture('Class_IntProfilDonnees',
['id' => 34,
'libelle' => 'Unimarc KTM']),
'type_operation' => Class_IntMajAuto::OP_FULL_IMPORT,
'nom_fichier' => 'lunel/[DATE]_records_tot.mrc',
'taille_min_import_total' => 0]);
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
$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('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('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);
Class_FileManager::setFileSystem($file_system);
Class_Cosmogramme_LandingDirectory::setSubdirCache($etalon);
Class_AdminVar::set('NOM_DOMAINE', 'http://localhost');
}
}
class Cosmo_IntegrationControllerWaitingFilesActionTest
extends Cosmo_IntegrationControllerWaitingFilesTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/cosmo/integration/waiting-files');
}
/** @test */
public function titleShouldBeFichiersEnAttenteDIntegration() {
$this->assertXPathContentContains('//h1', 'Fichiers en attente d\'intégration');
}
/** @test */
public function tableShouldContainsLunelDirectory() {
$this->assertXPathContentContains('//td', 'lunel');
}
/** @test */
public function tableShouldContainsLibraryLunel() {
$this->assertXPathContentContains('//td', 'Lunel');
}
/** @test */
public function linkToDeleteRecordTotShouldBePresent() {
$this->assertXPath('//a[@href = "/cosmo/integration/waiting-files-delete?id=%2Fccpl34%2Flunel%2F20190116220001_records_tot.mrc"]');
}
/** @test */
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é');
}
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
}
class Cosmo_IntegrationControllerWaitingFilesDeleteTest
extends Cosmo_IntegrationControllerWaitingFilesTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/cosmo/integration/waiting-files-delete?id=%2Fccpl34%2Flunel%2F20190116220001_records_tot.mrc');
}
/** @test */
public function recordsTotShouldBeDeleted() {
$this->assertTrue(Class_FileManager::getFileSystem()->methodHasBeenCalled('delete'));
}
}
class Cosmo_IntegrationControllerWaitingFilesDownloadTest
extends Cosmo_IntegrationControllerWaitingFilesTestCase {
/** @test */
public function totShouldBeRead() {
$this->dispatch('/cosmo/integration/waiting-files-download?id=%2Fccpl34%2Flunel%2F20190116220001_records_tot.mrc');
$this->assertTrue($this->_tot->methodHasBeenCalled('readfile'));
}