diff --git a/cosmogramme/tests/php/classes/ModelTestCase.php b/cosmogramme/tests/php/classes/ModelTestCase.php index a20794e25a7b7bc404e8cf5dd42add4aa1fe975a..92cf19ee005944c585c3417e29a30295cb0536b1 100644 --- a/cosmogramme/tests/php/classes/ModelTestCase.php +++ b/cosmogramme/tests/php/classes/ModelTestCase.php @@ -57,10 +57,10 @@ abstract class ModelTestCase extends PHPUnit_Framework_TestCase { $mock_results = $this->_buildRowset(array($fixture)); $this->_buildTableMock($model, array('find')) - ->expects($this->once()) - ->method('find') - ->with($id) - ->will($this->returnValue($mock_results)); + ->expects($this->once()) + ->method('find') + ->with($id) + ->will($this->returnValue($mock_results)); } @@ -68,6 +68,15 @@ abstract class ModelTestCase extends PHPUnit_Framework_TestCase { Storm_Model_Abstract::unsetLoaders(); if ($this->_storm_default_to_volatile) Storm_Model_Loader::defaultToVolatile(); + + Class_AdminVar::beVolatile(); + Class_AdminVar::set('CACHE_ACTIF', 0); + Class_AdminVar::set('NOM_DOMAINE', 'http://localhost'); + Class_AdminVar::set("AVIS_MIN_SAISIE", 0); + Class_AdminVar::set("AVIS_MAX_SAISIE", 100); + Class_Crypt::setPhpCommand($this->mock() + ->whenCalled('password_hash') + ->willDo(function($pass, $crypt) { return $pass; })); } @@ -75,6 +84,7 @@ abstract class ModelTestCase extends PHPUnit_Framework_TestCase { if($this->_storm_default_to_volatile) Storm_Model_Loader::defaultToDb(); Storm_Model_Abstract::unsetLoaders(); + Class_Crypt::setPhpCommand(null); } diff --git a/library/Class/Batch/BuildSiteMap.php b/library/Class/Batch/BuildSiteMap.php index 88ac67a32f106c8f8d99866506d1585e73141e0a..8f968a535f601025ef18e05e6247ab3945819d48 100644 --- a/library/Class/Batch/BuildSiteMap.php +++ b/library/Class/Batch/BuildSiteMap.php @@ -29,6 +29,7 @@ class Class_Batch_BuildSiteMap extends Class_Batch_Abstract { public function run() { + xdebug_break(); $sitemap = new Class_Sitemap(); $profiles = $this->sitemapProfiles(); diff --git a/library/Class/Crypt.php b/library/Class/Crypt.php index 37684aa60f4160946c50eb0f7630a801c77a0559..bfa0be3d613bcb60cfe5da2cb8bd2a5df242b86a 100644 --- a/library/Class/Crypt.php +++ b/library/Class/Crypt.php @@ -20,7 +20,9 @@ */ -class Class_Crypt { +class Class_Crypt { + use Trait_StaticPhpCommand; + /** @see http://php.net/manual/en/function.crypt.php CRYPT_BLOWFISH section */ const BLOWFISH_PATTERN = '/^\$2[axy]\$[0-9]{2}\$/'; @@ -30,6 +32,6 @@ class Class_Crypt { public function blowFishHashOf($value) { - return password_hash($value, PASSWORD_BCRYPT); + return $this->getPhpCommand()->password_hash($value, PASSWORD_BCRYPT); } } diff --git a/library/Class/PanierNotice.php b/library/Class/PanierNotice.php index d7e6a55b18ce219039c2e7e114e89eed65c18849..101e0e5b600bb2b572ab1799ea5d2b35bf6756eb 100644 --- a/library/Class/PanierNotice.php +++ b/library/Class/PanierNotice.php @@ -42,7 +42,7 @@ class PanierNoticeLoader extends Storm_Model_Loader { 'notices_paniers.id_user = bib_admin_users.id_user') ->where('bib_admin_users.ROLE_LEVEL >= ?', ZendAfi_Acl_AdminControllerRoles::MODO_BIB) ->order('notices_paniers.libelle'); - return $this->findAll($select); + return Class_PanierNotice::findAll($select); } diff --git a/library/Class/Testing/PhpCommand.php b/library/Class/Testing/PhpCommand.php index 4b44404aae345182b39662a326ecab24d0b3ada2..a4137afc850f3e12fcec53ad90326d3d328d4cea 100644 --- a/library/Class/Testing/PhpCommand.php +++ b/library/Class/Testing/PhpCommand.php @@ -24,6 +24,7 @@ class Class_Testing_PhpCommand extends Class_Testing_FileSystem { $this->_known_functions = array_merge($this->_known_functions, ['rand', 'hash', + 'password_hash', 'extension_loaded', 'libxml_use_internal_errors', 'libxml_get_errors']); diff --git a/tests/application/modules/AbstractControllerTestCase.php b/tests/application/modules/AbstractControllerTestCase.php index 2d5ed7ae7def2d1fe8f498ab021be13bf267dbfb..43415f4257672244338fb7e98da659f5d7a037b3 100644 --- a/tests/application/modules/AbstractControllerTestCase.php +++ b/tests/application/modules/AbstractControllerTestCase.php @@ -125,60 +125,32 @@ abstract class AbstractControllerTestCase extends Zend_Test_PHPUnit_ControllerTe $session = new Zend_Session_Namespace('FlashMessenger'); $session->unsetAll(); - $admin_var_loader = Class_AdminVar::getLoader(); - $admin_var_loader - ->newInstanceWithId('WORKFLOW') - ->setValeur(0); - - - $admin_var_loader - ->newInstanceWithId('FORCE_HTTPS') - ->setValeur(0); - - $admin_var_loader - ->newInstanceWithId('TEXT_REPLACEMENTS') - ->setValeur(''); - + Class_AdminVar::beVolatile(); Class_TextReplacements::reset(); - - $admin_var_loader - ->newInstanceWithId('LANGUES') - ->setValeur(null); - - $admin_var_loader - ->newInstanceWithId('CACHE_ACTIF') - ->setValeur(0); - - $admin_var_loader - ->newInstanceWithId('BIBNUM') - ->setValeur(1); - - $admin_var_loader - ->newInstanceWithId('OAI_SERVER') - ->setValeur(1); - - $admin_var_loader - ->newInstanceWithId('PACK_MOBILE') - ->setValeur(1); - - $admin_var_loader - ->newInstanceWithId('CNIL_CONSENT_ENABLE') - ->setValeur(false); - - Class_AdminVar::newInstanceWithId('JS_STAT', ['valeur' => '']); + Class_AdminVar::set('CACHE_ACTIF', 0); + Class_AdminVar::set('BIBNUM', 1); + Class_AdminVar::set('OAI_SERVER', 1); + Class_AdminVar::set('PACK_MOBILE', 1); + Class_AdminVar::set('CNIL_CONSENT_ENABLE', false); + Class_AdminVar::set('NOM_DOMAINE', 'http://localhost'); + Class_AdminVar::set("AVIS_MIN_SAISIE", 0); + Class_AdminVar::set("AVIS_MAX_SAISIE", 100); + Class_AdminVar::set("FORCE_HTTPS", 0); ZendAfi_Controller_Action_Helper_TrackEvent::setDefaultWebAnalyticsClient(null); Storm_Cache::setDefaultZendCache(null); Class_WebService_AllServices::setHttpClient(null); Class_SessionActivityInscription::beVolatile(); Class_Url::setBaseUrl(BASE_URL); Class_Url::setPhpMode('apache'); - Class_AdminVar::set('NOM_DOMAINE', 'http://localhost'); + Class_Crypt::setPhpCommand($this->mock() + ->whenCalled('password_hash') + ->willDo(function($pass, $crypt) { return $pass; })); Class_WebService_BibNumerique_RessourceNumerique::setCommand($this->mock()->whenCalled('execTimedScript')->answers('')); } public function tearDown() { - if($this->_storm_default_to_volatile) { + if ($this->_storm_default_to_volatile) { Storm_Model_Loader::defaultToDb(); Class_Versions::defaultToFile(); } @@ -195,7 +167,6 @@ abstract class AbstractControllerTestCase extends Zend_Test_PHPUnit_ControllerTe ZendAfi_Form_Element_Captcha::reset(); Class_Url::setBaseUrl(null); Class_Url::setPhpMode(null); - Class_AdminVar::set('NOM_DOMAINE', ''); Class_Log::resetInstance(); Class_WebService_BibNumerique_Vignette::resetInstance(); Class_WebService_BibNumerique_Vignette::resetHttpClient(); @@ -206,6 +177,7 @@ abstract class AbstractControllerTestCase extends Zend_Test_PHPUnit_ControllerTe ZendAfi_Acl_AdminControllerGroup::setAcl(null); Class_Systeme_ModulesAccueil::reset(); Class_Album::setFileSystem(null); + Class_Crypt::setPhpCommand(null); } diff --git a/tests/application/modules/admin/controllers/ImportFichierCsvElectreTest.php b/tests/application/modules/admin/controllers/ImportFichierCsvElectreTest.php index 74ef60befab51bf9fe93b51506c3b9770f0974f5..4a9e1d0d65bc42302a7f93eb17a58c56de0cc9cc 100644 --- a/tests/application/modules/admin/controllers/ImportFichierCsvElectreTest.php +++ b/tests/application/modules/admin/controllers/ImportFichierCsvElectreTest.php @@ -16,17 +16,19 @@ * * 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 ImportFichierCsvElectreThemeTest extends Storm_Test_ModelTestCase { +class ImportFichierCsvElectreThemeTest extends ModelTestCase { protected $_importTxt; protected $_file_contents; protected $file_writer; + protected $_storm_default_to_volatile = true; + public function setUp() { parent::setUp(); $this->importThesaurus = new Class_ImportFichierCsvThesaurus(); - + Storm_Test_ObjectWrapper::onLoaderOfModel('Class_CodifThesaurus') ->whenCalled('find') ->answers(null) @@ -57,14 +59,14 @@ class ImportFichierCsvElectreThemeTest extends Storm_Test_ModelTestCase { 'code' => '00010J000004', 'libelle' => 'Poésie' ], - + ]; } - /** + /** * @dataProvider expectedThesaurusCode - * @test + * @test */ public function getCodeAfiFromElectreShouldReturnLastNotEmptyLibelle($params, $code,$libelle) { $line=explode(';',$params['contents']); @@ -72,9 +74,9 @@ class ImportFichierCsvElectreThemeTest extends Storm_Test_ModelTestCase { $this->assertEquals($libelle,$this->importThesaurus->createCodifThesaurus($line,[3,2,2])->getLibelle()); } - /** + /** * @dataProvider expectedThesaurusCode - * @test + * @test */ public function getCodeAfiFromElectreShouldReturnCodeAfi($params, $code,$libelle) { $value=str_replace('"','',explode(';',$params['contents'])[0]); @@ -85,10 +87,12 @@ class ImportFichierCsvElectreThemeTest extends Storm_Test_ModelTestCase { } -class ImportFichierCsvElectrePublicTest extends Storm_Test_ModelTestCase { +class ImportFichierCsvElectrePublicTest extends ModelTestCase { protected $_importTxt; protected $_file_contents; protected $file_writer; + protected $_storm_default_to_volatile = true; + public function setUp() { parent::setUp(); $this->importThesaurus = new Class_ImportFichierCsvThesaurus(); @@ -100,18 +104,18 @@ class ImportFichierCsvElectrePublicTest extends Storm_Test_ModelTestCase { $this->importThesaurus->setCodeAndLibelleForThesaurus('thèmeelectre','Electre'); - + } public function expectedThesaurusCodePublic() { return [ [ - ['contents' => '"Tout public";"PG0000";"Grand public";;', + ['contents' => '"Tout public";"PG0000";"Grand public";;', 'sequence' => [2,2,2] ], 'code' => 'THEM00PG', 'libelle' => 'Grand public' - ], + ], [ ['contents' => '"Public débutant";"PS0302";"Public spécifique";"Autoformation";"Débutants"', 'sequence' => [2,2,2] ], @@ -140,9 +144,9 @@ class ImportFichierCsvElectrePublicTest extends Storm_Test_ModelTestCase { ]; } - /** + /** * @dataProvider expectedThesaurusCodePublic - * @test + * @test */ public function getCodeAfiFromElectrePublicShouldReturnLastNotEmptyLibelle($params, $code,$libelle) { $line=explode(';',$params['contents']); @@ -151,9 +155,9 @@ class ImportFichierCsvElectrePublicTest extends Storm_Test_ModelTestCase { } - /** + /** * @dataProvider expectedThesaurusCodePublic - * @test + * @test */ public function getCodifThesaurusFromThemeElectreShouldReturnCodeAfi($params, $code,$libelle) { @@ -163,18 +167,14 @@ class ImportFichierCsvElectrePublicTest extends Storm_Test_ModelTestCase { } - /** + /** * @dataProvider expectedThesaurusCodePublic - * @test + * @test */ public function getCodeAfiFromElectrePublicShouldReturnCodeAfi($params, $code,$libelle) { $value=str_replace('"','',explode(';',$params['contents'])[1]); - + $this->assertEquals($code,$this->importThesaurus->getCodeAfiFromElectre('THEM',$value,$params['sequence'])); } } - - - - diff --git a/tests/application/modules/admin/controllers/ImportFichierGenerationSiteTest.php b/tests/application/modules/admin/controllers/ImportFichierGenerationSiteTest.php index a2415a1147c6760cf99ed3e6e2ff049f86dd53eb..748efd20cbc95cd9d50206c91471c5f9fb5baa52 100644 --- a/tests/application/modules/admin/controllers/ImportFichierGenerationSiteTest.php +++ b/tests/application/modules/admin/controllers/ImportFichierGenerationSiteTest.php @@ -24,6 +24,7 @@ class ImportFichierGenerationSiteReadProfilTest extends ModelTestCase { protected $_importTxt; protected $_file_contents; protected $file_writer; + public function setUp() { parent::setUp(); @@ -223,12 +224,11 @@ class ImportFichierGenerationSiteReadProfilTest extends ModelTestCase { -class ImportFichierGenerationSiteDirectoryCreationReadProfilTest extends Storm_Test_ModelTestCase { +class ImportFichierGenerationSiteDirectoryCreationReadProfilTest extends ModelTestCase { protected $_importTxt; protected $file_writer; protected $profils; - - + protected $_storm_default_to_volatile = true; public function setUp() { parent::setUp(); diff --git a/tests/application/modules/admin/controllers/UsersControllerTest.php b/tests/application/modules/admin/controllers/UsersControllerTest.php index f8991c555b319485803733efda69266894e938f8..24ad730915986c55210f4ff77d318a31da3624b7 100644 --- a/tests/application/modules/admin/controllers/UsersControllerTest.php +++ b/tests/application/modules/admin/controllers/UsersControllerTest.php @@ -968,6 +968,7 @@ class Admin_UsersControllerFormEditAdminTest extends Admin_UsersControllerEditAd class UsersControllerPostEditAdminTest extends Admin_UsersControllerEditAdminTestCase { public function setUp() { parent::setUp(); + Class_Crypt::setPhpCommand(null); $this->postDispatch('/admin/users/edit/id/10', ['login' => 'Tom', 'password' => 'tutu', 'nom' => 'Davis', diff --git a/tests/application/modules/opac/controllers/DomainsControllerTest.php b/tests/application/modules/opac/controllers/DomainsControllerTest.php index d93459c6cc76ff2f568d6f0fcd811237386c76b4..b1349da1e09a0ece9ed002921349a553b5364250 100644 --- a/tests/application/modules/opac/controllers/DomainsControllerTest.php +++ b/tests/application/modules/opac/controllers/DomainsControllerTest.php @@ -37,6 +37,11 @@ abstract class DomainsControllerBrowseTestCase extends AbstractControllerTestCas 'root_domain_id' => 3 ]]); + $this->onLoaderOfModel('Class_Catalogue') + ->whenCalled('saveThesaurus') + ->answers(null); + + $this->fixture( 'Class_Catalogue', ['id' => 3, 'libelle' => 'Youth', 'url_img' => 'http://imgs/youth.png', diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 8276cf8b9dabcde00628a8aef0b45a8f99e3cc63..bb3c8304f5c2faff74eb358d6853c6eabc3f206d 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -90,6 +90,7 @@ $translate->setLocale('fr'); require_once 'tests/library/ZendAfi/View/Helper/ViewHelperTestCase.php'; require_once 'tests/application/modules/admin/controllers/AdminAbstractControllerTestCase.php'; +require_once 'tests/library/Class/ModelTestCase.php'; require_once 'tests/fixtures/RessourcesNumeriquesFixtures.php'; require_once 'tests/fixtures/MockedClasses.php'; require_once 'tests/application/modules/telephone/controllers/TelephoneAbstractControllerTestCase.php'; diff --git a/tests/library/Class/ActivityTest.php b/tests/library/Class/ActivityTest.php index 64657dd85162e97653212a2a00e883a1a341ed1c..4de26e043e875d876dce73a2e0c2beeab19e8b11 100644 --- a/tests/library/Class/ActivityTest.php +++ b/tests/library/Class/ActivityTest.php @@ -19,9 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class ActivityJavaWithNoSessionTest extends Storm_Test_ModelTestCase { - public function setUp() { +class ActivityJavaWithNoSessionTest extends ModelTestCase { + protected $_storm_default_to_volatile = true; + public function setUp() { Class_Activity::setTimeSource(new TimeSourceForTest('2014-05-01 14:00:00')); $this->_learning_java = $this->fixture('Class_Activity', @@ -47,11 +48,13 @@ class ActivityJavaWithNoSessionTest extends Storm_Test_ModelTestCase { } -class ActivitySmalltalkWithTwoSessionsTest extends Storm_Test_ModelTestCase { +class ActivitySmalltalkWithTwoSessionsTest extends ModelTestCase { protected $_patrick_inscription; protected $_patrick; protected $_laurent; protected $_laurent_intervention; + protected $_storm_default_to_volatile = true; + public function setUp() { parent::setUp(); @@ -262,7 +265,7 @@ class ActivitySmalltalkWithTwoSessionsTest extends Storm_Test_ModelTestCase { -class ActivityHaskellWithTwoSessionsAccrossYearTest extends Storm_Test_ModelTestCase { +class ActivityHaskellWithTwoSessionsAccrossYearTest extends ModelTestCase { public function setUp() { $this->_learn_haskell = Class_Activity::getLoader() ->newInstanceWithId(5) diff --git a/tests/library/Class/AdminVarTest.php b/tests/library/Class/AdminVarTest.php index cbfc80e43c5fa56af7dd987c308ce6f1a6bcb1e4..e8c96d6b8b0359dd21b45d3d80cd3a501c98c259 100644 --- a/tests/library/Class/AdminVarTest.php +++ b/tests/library/Class/AdminVarTest.php @@ -124,7 +124,7 @@ class AdminVarTestSet extends AdminVarTestCase { -class AdminVarBabelthequeTest extends Storm_Test_ModelTestCase { +class AdminVarBabelthequeTest extends ModelTestCase { /** @test */ public function babelthequeIdShouldBeExtractedFromVarBabelthequeJS() { Class_AdminVar::newInstanceWithId('BABELTHEQUE_JS') @@ -145,7 +145,7 @@ class AdminVarBabelthequeTest extends Storm_Test_ModelTestCase { -class AdminVarWorkflowTest extends Storm_Test_ModelTestCase { +class AdminVarWorkflowTest extends ModelTestCase { public function setup() { parent::setup(); Class_AdminVar::beVolatile(); diff --git a/tests/library/Class/AgendaSQYImportTest.php b/tests/library/Class/AgendaSQYImportTest.php index f8eafbd9ddc8708dd574772d15524dd4abba595c..01afd22bf7492e12fd3c05be227b408a9532bcb5 100644 --- a/tests/library/Class/AgendaSQYImportTest.php +++ b/tests/library/Class/AgendaSQYImportTest.php @@ -20,7 +20,7 @@ */ -class AgendaSQYImportTest extends Storm_Test_ModelTestCase { +class AgendaSQYImportTest extends ModelTestCase { protected static $_agenda, $_article_loader, diff --git a/tests/library/Class/Album/UsageConstraintTest.php b/tests/library/Class/Album/UsageConstraintTest.php index 8bb6b0967abc84699ee343b58d5f2b0fb30c05e4..9b80d76a91694f189a7c8aa1f8b78a3bf96a6d8c 100644 --- a/tests/library/Class/Album/UsageConstraintTest.php +++ b/tests/library/Class/Album/UsageConstraintTest.php @@ -18,7 +18,7 @@ * along with BOKEH; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class Class_Album_UsageConstraintTest extends Storm_Test_ModelTestCase { +class Class_Album_UsageConstraintTest extends ModelTestCase { public function setUp() { parent::setUp(); diff --git a/tests/library/Class/AlbumRessource/LeafletTilesGeneratorTest.php b/tests/library/Class/AlbumRessource/LeafletTilesGeneratorTest.php index d0fbae813b47efb79123c6f0fd7ad16315ce6de0..6109bc010a2a2ac7e9dc99bb9f69380e7e09268b 100644 --- a/tests/library/Class/AlbumRessource/LeafletTilesGeneratorTest.php +++ b/tests/library/Class/AlbumRessource/LeafletTilesGeneratorTest.php @@ -16,10 +16,10 @@ * * 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_AlbumRessource_LeafletTilesGeneratorTest extends Storm_Test_ModelTestCase { - protected +class Class_AlbumRessource_LeafletTilesGeneratorTest extends ModelTestCase { + protected $_convert_command, $_file_writer; @@ -64,28 +64,28 @@ class Class_AlbumRessource_LeafletTilesGeneratorTest extends Storm_Test_ModelTes public function withAlternateImageMagickPathShouldNotUseConvert() { Class_AlbumRessource_LeafletTilesGenerator::setImageMagickPath('/usr/local/bin/magick'); $this->_generator->ensureTilesGenerated(); - $this->assertContains('/usr/local/bin/magick ', + $this->assertContains('/usr/local/bin/magick ', $this->_mock_system_command->getFirstAttributeForLastCallOn('system')); } /** @test */ public function hugeImagePathShouldBeGivenToConvert() { - $this->assertContains('userfiles/album/3/big/media/huge_image.jpg ', + $this->assertContains('userfiles/album/3/big/media/huge_image.jpg ', $this->_convert_command); } - + /** @test */ public function filenameShouldContainsTilesPathDirectoryForZoomLevel5() { - $this->assertContains('-set filename:f "'.USERFILESPATH.'/album/3/tiles/98/5', + $this->assertContains('-set filename:f "'.USERFILESPATH.'/album/3/tiles/98/5', $this->_convert_command); } /** @test */ public function filenameShouldContainsTilesPathDirectoryForZoomLevel2() { - $this->assertContains('-set filename:f "'.USERFILESPATH.'/album/3/tiles/98/2', + $this->assertContains('-set filename:f "'.USERFILESPATH.'/album/3/tiles/98/2', $this->_convert_command); } diff --git a/tests/library/Class/AlbumTest.php b/tests/library/Class/AlbumTest.php index fe93e01af1b652eab6048d16d328206306a0cccb..d4d45974fc5f860571ae069ca5dbf65ca275fb63 100644 --- a/tests/library/Class/AlbumTest.php +++ b/tests/library/Class/AlbumTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -abstract class AlbumHarlockTestCase extends Storm_Test_ModelTestCase { +abstract class AlbumHarlockTestCase extends ModelTestCase { /** @var Storm_Test_ObjectWrapper */ protected $_wrapper; @@ -694,7 +694,7 @@ class AlbumHarlockSortingResourcesTest extends AlbumHarlockTestCase { -class AlbumDeletingTestCase extends Storm_Test_ModelTestCase { +class AlbumDeletingTestCase extends ModelTestCase { protected $_storm_default_to_volatile = true; public function setUp() { diff --git a/tests/library/Class/ArteVodLinkTest.php b/tests/library/Class/ArteVodLinkTest.php index 691a0abd00e6d03c43bcaafbaea6b79487f04adb..90ccaf80a99405882082e5881a0717fa69bbbbf5 100644 --- a/tests/library/Class/ArteVodLinkTest.php +++ b/tests/library/Class/ArteVodLinkTest.php @@ -20,7 +20,7 @@ */ -class ArteVodLinkBaseUrlWithoutAlbumTest extends Storm_Test_ModelTestCase { +class ArteVodLinkBaseUrlWithoutAlbumTest extends ModelTestCase { public function setUp() { $this->fixture('Class_AdminVar', ['id' => 'ARTE_VOD_LOGIN', @@ -39,7 +39,7 @@ class ArteVodLinkBaseUrlWithoutAlbumTest extends Storm_Test_ModelTestCase { -class ArteVodLinkWithUserAndAlbumTest extends Storm_Test_ModelTestCase { +class ArteVodLinkWithUserAndAlbumTest extends ModelTestCase { protected $_james_bond; protected $_arte_vod_link; diff --git a/tests/library/Class/ArticleCategorieTest.php b/tests/library/Class/ArticleCategorieTest.php index 577bc2b52af6407d6643433d80b96892cf1140c1..915c574512d6cb1d6508ef8325bb97483879e36f 100644 --- a/tests/library/Class/ArticleCategorieTest.php +++ b/tests/library/Class/ArticleCategorieTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class ArticleCategorieTest extends Storm_Test_ModelTestCase { +class ArticleCategorieTest extends ModelTestCase { public function setUp() { $this->annecy = Class_Bib::newInstanceWithId(21, ['libelle' => 'Annecy']); @@ -336,7 +336,7 @@ JSON; -class ArticleCategorieParentTest extends Storm_Test_ModelTestCase { +class ArticleCategorieParentTest extends ModelTestCase { protected $_news; public function setUp() { diff --git a/tests/library/Class/ArticleTest.php b/tests/library/Class/ArticleTest.php index 6968b19d22a6eea910fc05d73585bbf8f71a4356..e773cd5676401ef7f27c3c8a3ad043cb4ab14265 100644 --- a/tests/library/Class/ArticleTest.php +++ b/tests/library/Class/ArticleTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class ArticleWithTraductionsTest extends Storm_Test_ModelTestCase { +class ArticleWithTraductionsTest extends ModelTestCase { public function setUp() { $this->concert = Class_Article::getLoader() ->newInstanceWithId(4) @@ -368,7 +368,7 @@ class ArticleWithTraductionsTest extends Storm_Test_ModelTestCase { -class ArticleTestSmallArticle extends Storm_Test_ModelTestCase { +class ArticleTestSmallArticle extends ModelTestCase { /** @var Class_Article */ protected $_article; @@ -449,7 +449,7 @@ class ArticleTestSmallArticle extends Storm_Test_ModelTestCase { -class ArticleTestSummaryAndFullContentForArticleWithEndTag extends Storm_Test_ModelTestCase { +class ArticleTestSummaryAndFullContentForArticleWithEndTag extends ModelTestCase { /** @var Class_Article */ protected $_article; @@ -479,7 +479,7 @@ class ArticleTestSummaryAndFullContentForArticleWithEndTag extends Storm_Test_Mo -class ArticleTestSummaryAndFullContentForArticleWithDescription extends Storm_Test_ModelTestCase { +class ArticleTestSummaryAndFullContentForArticleWithDescription extends ModelTestCase { /** @var Class_Article */ protected $_article; @@ -525,7 +525,7 @@ class ArticleTestSummaryAndFullContentForArticleWithDescription extends Storm_Te -class ArticleTestSummaryAndFullContentForArticleWithEmptyDescription extends Storm_Test_ModelTestCase { +class ArticleTestSummaryAndFullContentForArticleWithEmptyDescription extends ModelTestCase { /** @var Class_Article */ protected $_article; @@ -562,7 +562,7 @@ class ArticleTestSummaryAndFullContentForArticleWithEmptyDescription extends Sto -class ArticleTestEmptyDates extends Storm_Test_ModelTestCase { +class ArticleTestEmptyDates extends ModelTestCase { /** @var Class_Article */ protected $_article; @@ -595,7 +595,7 @@ class ArticleTestEmptyDates extends Storm_Test_ModelTestCase { -class ArticleTestFutureStartDate extends Storm_Test_ModelTestCase { +class ArticleTestFutureStartDate extends ModelTestCase { /** @var Class_Article */ protected $_article; @@ -627,7 +627,7 @@ class ArticleTestFutureStartDate extends Storm_Test_ModelTestCase { -class ArticleTestPastStartDate extends Storm_Test_ModelTestCase { +class ArticleTestPastStartDate extends ModelTestCase { /** @var Class_Article */ protected $_article; @@ -661,7 +661,7 @@ class ArticleTestPastStartDate extends Storm_Test_ModelTestCase { -class ArticleTestFutureEndDate extends Storm_Test_ModelTestCase { +class ArticleTestFutureEndDate extends ModelTestCase { /** @var Class_Article */ protected $_article; @@ -700,7 +700,7 @@ class ArticleTestFutureEndDate extends Storm_Test_ModelTestCase { -class ArticleTestPastEndDate extends Storm_Test_ModelTestCase { +class ArticleTestPastEndDate extends ModelTestCase { /** @var Class_Article */ protected $_article; @@ -738,7 +738,7 @@ class ArticleTestPastEndDate extends Storm_Test_ModelTestCase { -class ArticleTestAllPastDates extends Storm_Test_ModelTestCase { +class ArticleTestAllPastDates extends ModelTestCase { /** @var Class_Article */ protected $_article; @@ -776,7 +776,7 @@ class ArticleTestAllPastDates extends Storm_Test_ModelTestCase { -class ArticleTestAllFutureDates extends Storm_Test_ModelTestCase { +class ArticleTestAllFutureDates extends ModelTestCase { /** @var Class_Article */ protected $_article; @@ -814,7 +814,7 @@ class ArticleTestAllFutureDates extends Storm_Test_ModelTestCase { -class ArticleTestDatesIncludesNow extends Storm_Test_ModelTestCase { +class ArticleTestDatesIncludesNow extends ModelTestCase { /** @var Class_Article */ protected $_article; @@ -986,7 +986,7 @@ class ArticleTestFixtures { -class EventsByMonthNoArticlesTest extends Storm_Test_ModelTestCase { +class EventsByMonthNoArticlesTest extends ModelTestCase { public function setup() { parent::setup(); @@ -1008,7 +1008,7 @@ class EventsByMonthNoArticlesTest extends Storm_Test_ModelTestCase { -abstract class EventsByMonthWithArticleTestCase extends Storm_Test_ModelTestCase { +abstract class EventsByMonthWithArticleTestCase extends ModelTestCase { protected $concert; public function setup() { diff --git a/tests/library/Class/Autocomplete/IndexTest.php b/tests/library/Class/Autocomplete/IndexTest.php index eb9a87dbb713d5f9ceb36d1d349bddae42e17ef3..036b8246d75bb5dea54e37b319201448d808a3bb 100644 --- a/tests/library/Class/Autocomplete/IndexTest.php +++ b/tests/library/Class/Autocomplete/IndexTest.php @@ -16,11 +16,11 @@ * * 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_Autocomplete_IndexTest extends Storm_Test_ModelTestCase{ +class Class_Autocomplete_IndexTest extends ModelTestCase{ protected $_file_system; public function setUp() { @@ -66,8 +66,8 @@ class Class_Autocomplete_IndexTest extends Storm_Test_ModelTestCase{ ]); $notice->save(); - - + + Class_Autocomplete_Index::indexRecordsTitle(); $this->assertEquals([$handle, "La jeune fille de Souleymane Cissé\n"],$this->_file_system->getAttributesForLastCallOn('fwrite')); } @@ -85,7 +85,7 @@ class Class_Autocomplete_IndexTest extends Storm_Test_ModelTestCase{ ['id' => 1301, 'titre_principal' => 'Bone of my bones', 'auteur_principal' => '']); - + Class_Autocomplete_Index::indexRecordsTitle(); $this->assertTrue( diff --git a/tests/library/Class/AvisNoticeTest.php b/tests/library/Class/AvisNoticeTest.php index 62cefbf137053b590a5669a1d80cbb8fb6244ca2..88885ed87c752ec1100de1c96ceea45f8fb9f1c9 100644 --- a/tests/library/Class/AvisNoticeTest.php +++ b/tests/library/Class/AvisNoticeTest.php @@ -352,7 +352,7 @@ class AvisTestFindAllByUserAndClefOeuvreTestCase extends AvisTestFindAllTestCase -class NoticeTestHasManyAvisTest extends Storm_Test_ModelTestCase { +class NoticeTestHasManyAvisTest extends ModelTestCase { public function setUp() { $this->millenium = $this->fixture('Class_Notice', ['id' => 34, 'clef_oeuvre' => 'MILLENIUM--LARSSON']); @@ -789,7 +789,7 @@ class AvisVisibilityTest extends ModelTestCase { } -class AvisNoticeAvisFromPreferencesTest extends Storm_Test_ModelTestCase { +class AvisNoticeAvisFromPreferencesTest extends ModelTestCase { public function setUp() { parent::setUp(); Class_Users::beVolatile(); @@ -993,7 +993,7 @@ class AvisNoticeAvisFromPreferencesTest extends Storm_Test_ModelTestCase { -class AvisNoticeWithSameArtworkKeyTest extends Storm_Test_ModelTestCase { +class AvisNoticeWithSameArtworkKeyTest extends ModelTestCase { public function setUp() { parent::setUp(); diff --git a/tests/library/Class/AvisTest.php b/tests/library/Class/AvisTest.php index 337f745819b90e431a8494f5483f5664d729d0db..500a06092686c2a56bc3ecd45532bd854f337d7a 100644 --- a/tests/library/Class/AvisTest.php +++ b/tests/library/Class/AvisTest.php @@ -16,13 +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 AvisCmsOnArticleConcertTest extends Storm_Test_ModelTestCase { - protected - $_concert, - $_laurent, +class AvisCmsOnArticleConcertTest extends ModelTestCase { + protected + $_concert, + $_laurent, $_avis_laurent; @@ -55,7 +55,7 @@ class AvisCmsOnArticleConcertTest extends Storm_Test_ModelTestCase { $this->assertEquals($this->_concert, $this->_avis_laurent->getArticle()); } - + /** @test */ public function laurentGetAvisArticleShouldAnswersArrayWithAvisLaurent() { $this->assertEquals([$this->_avis_laurent], $this->_laurent->getAvisArticles()); diff --git a/tests/library/Class/BatchTest.php b/tests/library/Class/BatchTest.php index 9b52b3119796d4b2ac3611f485b8ea0b937c9e5e..968813261b7b97711f20c4fca9f722fe784cf028 100644 --- a/tests/library/Class/BatchTest.php +++ b/tests/library/Class/BatchTest.php @@ -21,7 +21,7 @@ include_once('tests/fixtures/HarvestOrpheaFixtures.php'); include_once('tests/fixtures/RessourcesNumeriquesFixtures.php'); -class BatchModelTest extends Storm_Test_ModelTestCase { +class BatchModelTest extends ModelTestCase { public function setUp(){ parent::setUp(); $this->moissonage_vodeclic = $this->fixture('Class_Batch', @@ -99,7 +99,7 @@ class BatchModelTest extends Storm_Test_ModelTestCase { -class BatchLoaderWithoutRessourcesNumeriquesTest extends Storm_Test_ModelTestCase { +class BatchLoaderWithoutRessourcesNumeriquesTest extends ModelTestCase { public function setUp() { parent::setUp(); @@ -121,7 +121,7 @@ class BatchLoaderWithoutRessourcesNumeriquesTest extends Storm_Test_ModelTestCas -class BatchIndexRessourcesNumeriquesTest extends Storm_Test_ModelTestCase { +class BatchIndexRessourcesNumeriquesTest extends ModelTestCase { public function setUp() { $album = $this->fixture('Class_Album', ['id' => 1, 'titre' => 'Mon Album', @@ -151,12 +151,14 @@ class BatchIndexRessourcesNumeriquesTest extends Storm_Test_ModelTestCase { -class BatchBuildSitemapTest extends Storm_Test_ModelTestCase { +class BatchBuildSitemapTest extends ModelTestCase { protected $_file_system; protected $_profiles; public function setUp() { parent::setup(); + Class_AdminVar::set('NOM_DOMAINE', 'wiki.bokeh-library-portal.org'); + Class_Url::setPhpMode('cli'); Zend_Controller_Front::getInstance()->setRouter(new ZendAfi_Controller_Router_RewriteWithoutBaseUrl()); @@ -176,8 +178,6 @@ class BatchBuildSitemapTest extends Storm_Test_ModelTestCase { 'cfg_accueil' => ZendAfi_Filters_Serialize::serialize(['sitemap' => 1]), 'rewrite_url' => 'my-url']); - Class_Profil::beVolatile(); - $this->handle = new stdClass; $this->_file_system = $this->mock() ->whenCalled('fopen')->with(ROOT_PATH.'temp/sitemap.xml', 'w')->answers($this->handle) @@ -185,11 +185,6 @@ class BatchBuildSitemapTest extends Storm_Test_ModelTestCase { ->whenCalled('unlink')->answers(null); Class_Sitemap::setFileSystem($this->_file_system); - - $this->fixture('Class_AdminVar', ['id' => 'NOM_DOMAINE', - 'clef' => 'NOM_DOMAINE', - 'valeur' => 'wiki.bokeh-library-portal.org']); - } @@ -215,6 +210,11 @@ class BatchBuildSitemapTest extends Storm_Test_ModelTestCase { </url> </urlset> '; + $this->assertTrue($this->_file_system + ->methodHasBeenCalled('fwrite')); + + $this->assertEquals($expected, + $this->_file_system->getAttributesForLastCallOn('fwrite')[1]); $this->assertTrue($this->_file_system ->methodHasBeenCalledWithParams('fwrite', diff --git a/tests/library/Class/BibTest.php b/tests/library/Class/BibTest.php index 67d6ab594417c4cc1fad24a3fd453823db61b7e4..45765a3194c0318f0917d53c249236045b4c2571 100644 --- a/tests/library/Class/BibTest.php +++ b/tests/library/Class/BibTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class BibTest extends Storm_Test_ModelTestCase { +class BibTest extends ModelTestCase { /** @test */ function loaderFindAllWithPortailShouldIncludePortail() { $this->assertEquals(0, @@ -93,7 +93,7 @@ class BibTest extends Storm_Test_ModelTestCase { -class BibFindAllWithPortailTest extends Storm_Test_ModelTestCase { +class BibFindAllWithPortailTest extends ModelTestCase { protected $_storm_default_to_volatile = true; diff --git a/tests/library/Class/CatalogueTest.php b/tests/library/Class/CatalogueTest.php index d151e884fa0f395794194cb04d705114532122ce..f170b7b29e7c47cfb26d144242f68c9b27ca0be5 100644 --- a/tests/library/Class/CatalogueTest.php +++ b/tests/library/Class/CatalogueTest.php @@ -80,7 +80,7 @@ class CatalogueTestGetRequetesPanierWithIdUserAndIdPanier extends ModelTestCase } -class CatalogueTestGetRequetesPanierWithIdUserAndIdPanierUsedForId extends Storm_Test_ModelTestCase { +class CatalogueTestGetRequetesPanierWithIdUserAndIdPanierUsedForId extends ModelTestCase { public function setUp() { parent::setUp(); @@ -738,7 +738,7 @@ class CatalogueParentTest extends ModelTestCase { } -class CatalogueBuildCriteresRechercheTest extends Storm_Test_ModelTestCase { +class CatalogueBuildCriteresRechercheTest extends ModelTestCase { public function setUp() { parent::setUp(); diff --git a/tests/library/Class/CodificationTest.php b/tests/library/Class/CodificationTest.php index 4dde45a991548f0a6199d3c3eb729880b8c1b6d5..8d6f67078bfaa74f28fda46560893b029d3c1806 100644 --- a/tests/library/Class/CodificationTest.php +++ b/tests/library/Class/CodificationTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class CodificationNomChampsTest extends Storm_Test_ModelTestCase { +class CodificationNomChampsTest extends ModelTestCase { public function setUp() { parent::setUp(); $this->old_sql = Zend_Registry::get('sql'); diff --git a/tests/library/Class/DecodageUnimarcTest.php b/tests/library/Class/DecodageUnimarcTest.php index ef36a23da20d9bcc250945c58dcb31f28a6eaca6..d306b3aa18bb6ce9635e7ab0e5df2d3140ee1434 100644 --- a/tests/library/Class/DecodageUnimarcTest.php +++ b/tests/library/Class/DecodageUnimarcTest.php @@ -20,7 +20,7 @@ */ -class DecodageUnimarcDVDLaJeuneFilleTest extends Storm_Test_ModelTestCase { +class DecodageUnimarcDVDLaJeuneFilleTest extends ModelTestCase { public function setUp() { parent::setUp(); Class_CodifLangue::getLoader() @@ -311,7 +311,7 @@ class DecodageUnimarcConcertoAuteursTest extends PHPUnit_Framework_TestCase { } -class DecodageUnimarcDVDUnHerosTresDiscretTest extends Storm_Test_ModelTestCase { +class DecodageUnimarcDVDUnHerosTresDiscretTest extends ModelTestCase { protected $_storm_default_to_volatile = true; @@ -390,7 +390,7 @@ class DecodageUnimarcDVDUnHerosTresDiscretTest extends Storm_Test_ModelTestCase -class DecodageUnimarcCDKayaTest extends Storm_Test_ModelTestCase { +class DecodageUnimarcCDKayaTest extends ModelTestCase { protected $_storm_default_to_volatile = true; @@ -437,7 +437,7 @@ class DecodageUnimarcCDKayaTest extends Storm_Test_ModelTestCase { -class DecodageUnimarcVieDAdeleTest extends Storm_Test_ModelTestCase { +class DecodageUnimarcVieDAdeleTest extends ModelTestCase { protected $_storm_default_to_volatile = true; diff --git a/tests/library/Class/DuplicateInProfilTest.php b/tests/library/Class/DuplicateInProfilTest.php index a6ab5a18e25f074b858b26be8d24fe066b4bf670..bb1cfa7e450e69b0892ff2141c36c085e293f9a3 100644 --- a/tests/library/Class/DuplicateInProfilTest.php +++ b/tests/library/Class/DuplicateInProfilTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -abstract class DuplicateInProfilTestCase extends Storm_Test_ModelTestCase { +abstract class DuplicateInProfilTestCase extends ModelTestCase { protected $current_profil; public function setUp() { diff --git a/tests/library/Class/DynamicUserGroupTest.php b/tests/library/Class/DynamicUserGroupTest.php index 1511e5f9624e5f2e5cd8392b01342837785187dc..97a9b32bc0bbff231ef1c1b521f8e8706f2c2efb 100644 --- a/tests/library/Class/DynamicUserGroupTest.php +++ b/tests/library/Class/DynamicUserGroupTest.php @@ -20,7 +20,7 @@ */ -abstract class DynamicUserGroupTestCase extends Storm_Test_ModelTestCase { +abstract class DynamicUserGroupTestCase extends ModelTestCase { public function setUp() { parent::setUp(); Storm_Model_Loader::defaultToVolatile(); diff --git a/tests/library/Class/EADTest.php b/tests/library/Class/EADTest.php index 1997395b173592b6c46553ce041c882cb0b44ada..1f4386d6c8eca58cbceccbe6369043acc259177b 100644 --- a/tests/library/Class/EADTest.php +++ b/tests/library/Class/EADTest.php @@ -52,7 +52,7 @@ class EADFolioMoulinsTest extends PHPUnit_Framework_TestCase { -class EADEmptyLoadTest extends Storm_Test_ModelTestCase { +class EADEmptyLoadTest extends ModelTestCase { protected $_ead; public function setUp() { @@ -489,7 +489,7 @@ class EADMoulinsTest extends PHPUnit_Framework_TestCase { -class EADIndexationParDefautTest extends Storm_Test_ModelTestCase { +class EADIndexationParDefautTest extends ModelTestCase { public function setUp() { parent::setUp(); diff --git a/tests/library/Class/ExemplaireTest.php b/tests/library/Class/ExemplaireTest.php index be2fd7d1582fa134d3da219512cfe152bc2bf3f4..4c0301fe817485102cb276cca22a1f926ec5bbf9 100644 --- a/tests/library/Class/ExemplaireTest.php +++ b/tests/library/Class/ExemplaireTest.php @@ -16,11 +16,11 @@ * * 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_ExemplaireTest extends Storm_Test_ModelTestCase { +class Class_ExemplaireTest extends ModelTestCase { public function setUp() { parent::setUp(); @@ -51,10 +51,10 @@ class Class_ExemplaireTest extends Storm_Test_ModelTestCase { $exemplaire = Class_Exemplaire::newInstanceWithId(34, ['notice'=>Class_Notice::newInstanceWithId(12), 'int_bib'=>$int_bib]); - + $this->assertFalse($exemplaire->isReservable()); } - + /** @test */ public function exemplaireIsSigbExemplaireAndIsReservableShouldBeReservable() { $sigb_exemplaire= Storm_Test_ObjectWrapper::mock() diff --git a/tests/library/Class/FRBR/LinkTest.php b/tests/library/Class/FRBR/LinkTest.php index 9969a3b82bafc16f45267189d2e1b7c39538b4a9..495ff07dbc1aa8a439e3d7c50e7d360285998871 100644 --- a/tests/library/Class/FRBR/LinkTest.php +++ b/tests/library/Class/FRBR/LinkTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class FRBR_LinkWrongAttributesTest extends Storm_Test_ModelTestCase { +class FRBR_LinkWrongAttributesTest extends ModelTestCase { public function setUp() { parent::setUp(); diff --git a/tests/library/Class/FormulaireTest.php b/tests/library/Class/FormulaireTest.php index bf1a383e0fc72ad625f4a4b93af79a63b39edc28..a33240d84b632498d4ccaa3f9b7477bc6a64900f 100644 --- a/tests/library/Class/FormulaireTest.php +++ b/tests/library/Class/FormulaireTest.php @@ -16,10 +16,10 @@ * * 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 FormulaireTest extends Storm_Test_ModelTestCase { +class FormulaireTest extends ModelTestCase { public function setUp() { parent::setUp(); $this->_jessy = Class_Users::newInstanceWithId(77, ['login' => 'Jessy']); @@ -42,14 +42,14 @@ class FormulaireTest extends Storm_Test_ModelTestCase { /** @test */ public function userFantomasShouldHaveOneFormulaire() { - $this->assertEquals([$this->_formulaire], + $this->assertEquals([$this->_formulaire], $this->_fantomas->getFormulaires()); } /** @test */ public function articleShouldHaveOneFormulaire() { - $this->assertEquals([$this->_formulaire], + $this->assertEquals([$this->_formulaire], $this->_article->getFormulaires()); } diff --git a/tests/library/Class/GlobalSqlRefactoringTest.php b/tests/library/Class/GlobalSqlRefactoringTest.php index 1ca5e21042874f475962c0bfef0995ad7a655fdd..e69f8f6a2fb52905f00f60cb48eea004f28b1f52 100644 --- a/tests/library/Class/GlobalSqlRefactoringTest.php +++ b/tests/library/Class/GlobalSqlRefactoringTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class GlobalSqlRefactoringTest extends Storm_Test_ModelTestCase { +class GlobalSqlRefactoringTest extends ModelTestCase { protected $_old_sql; public function setUp() { diff --git a/tests/library/Class/IntBibTest.php b/tests/library/Class/IntBibTest.php index 61374f19545fa6b30e9462284142dd32e3de5fa5..47358fd439e636b941dc99dea91202c701dd1289 100644 --- a/tests/library/Class/IntBibTest.php +++ b/tests/library/Class/IntBibTest.php @@ -20,7 +20,7 @@ */ -class IntBibTest extends Storm_Test_ModelTestCase { +class IntBibTest extends ModelTestCase { public function setUp() { parent::setUp(); $this->fixture('Class_IntBib', ['id' => 3, @@ -51,7 +51,7 @@ class IntBibTest extends Storm_Test_ModelTestCase { -class IntBibSingleNanookTest extends Storm_Test_ModelTestCase { +class IntBibSingleNanookTest extends ModelTestCase { protected $_storm_default_to_volatile = true, $_id_int_bib; diff --git a/tests/library/Class/KidilanguesLinkTest.php b/tests/library/Class/KidilanguesLinkTest.php index d6b6bfdbae8f1f7c32d180bcf2c7a4709ac196c6..7865f6b9a7316f69df48e1c678d726728f9144cd 100644 --- a/tests/library/Class/KidilanguesLinkTest.php +++ b/tests/library/Class/KidilanguesLinkTest.php @@ -22,7 +22,7 @@ include_once('tests/fixtures/RessourcesNumeriquesFixtures.php'); -abstract class KidilanguesLinkTestCase extends Storm_Test_ModelTestCase { +abstract class KidilanguesLinkTestCase extends ModelTestCase { public function setUp() { parent::setUp(); Storm_Model_Loader::defaultToVolatile(); diff --git a/tests/library/Class/LeSocialLinkTest.php b/tests/library/Class/LeSocialLinkTest.php index 033525a51be00627cebcd043dc22182f53e68a21..d84a4c0c5e2a6cd01f03a5fa6f086d25cfb0fbdb 100644 --- a/tests/library/Class/LeSocialLinkTest.php +++ b/tests/library/Class/LeSocialLinkTest.php @@ -20,7 +20,7 @@ */ -class LeSocialLinkTest extends Storm_Test_ModelTestCase { +class LeSocialLinkTest extends ModelTestCase { protected $link; protected $_storm_default_to_volatile = true; protected $user; diff --git a/tests/library/Class/LieuTest.php b/tests/library/Class/LieuTest.php index d247e3f752766ede2867b6c3880e6989e52f7660..c9e7a7aa1a365135d307ff45ccb57d9d5f19cc68 100644 --- a/tests/library/Class/LieuTest.php +++ b/tests/library/Class/LieuTest.php @@ -16,11 +16,11 @@ * * 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 LieuTest extends Storm_Test_ModelTestCase { +class LieuTest extends ModelTestCase { /** @test */ public function lieuShouldNotBeValidWithoutLibelle() { diff --git a/tests/library/Class/ListesNoticesTest.php b/tests/library/Class/ListesNoticesTest.php index 15f053061e67b5247ab23114c8beae16348f4964..5b1f3665e8287c019b34f08e9d6ffa10ebde77c7 100644 --- a/tests/library/Class/ListesNoticesTest.php +++ b/tests/library/Class/ListesNoticesTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class ListesNoticesTest extends Storm_Test_ModelTestCase { +class ListesNoticesTest extends ModelTestCase { protected $_original_sql, $_mock_sql; public function setUp() { diff --git a/tests/library/Class/LocalisationTest.php b/tests/library/Class/LocalisationTest.php index ef9eabc9c23d3672d8d6cc66763464da9b81cbb6..bc273289f43094a5e95712e8a49bae074b0926e6 100644 --- a/tests/library/Class/LocalisationTest.php +++ b/tests/library/Class/LocalisationTest.php @@ -20,7 +20,7 @@ */ -class LocalisationTest extends Storm_Test_ModelTestCase { +class LocalisationTest extends ModelTestCase { public function setUp() { parent::setUp(); diff --git a/tests/library/Class/MatiereTest.php b/tests/library/Class/MatiereTest.php index 8845359f0eab157ec1b0516c58bacf01583de4fd..ac5a03ca8be44bcf16841c22be2dec0f144e104f 100644 --- a/tests/library/Class/MatiereTest.php +++ b/tests/library/Class/MatiereTest.php @@ -16,16 +16,16 @@ * * 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 MatiereTest extends Storm_Test_ModelTestCase { +class MatiereTest extends ModelTestCase { /** @test */ function sqlQueriesShouldBeEscaped() { Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Matiere') ->whenCalled('findAllBy') ->with(array('where' => 'libelle LIKE \'L\'\'art du 20ème : %\'')) - ->answers(array(Class_Matiere::getLoader()->newInstanceWithId(12), + ->answers(array(Class_Matiere::getLoader()->newInstanceWithId(12), Class_Matiere::getLoader()->newInstanceWithId(24))); $matiere = Class_Matiere::getLoader() diff --git a/tests/library/Class/MigrationTest.php b/tests/library/Class/MigrationTest.php index d2ed1de46e9dc425799e9908e1be99c2b1632f14..c3492169e1e27d7252abde58f96f7f212f077ce4 100644 --- a/tests/library/Class/MigrationTest.php +++ b/tests/library/Class/MigrationTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -abstract class MigrationTestCase extends Storm_Test_ModelTestCase { +abstract class MigrationTestCase extends ModelTestCase { protected $_old_sql; public function setUp() { diff --git a/tests/library/Class/ModelTestCase.php b/tests/library/Class/ModelTestCase.php index 49b6b6aee445ffa9f708348bb6fb83cebd8a0ef6..6f996ab370f2f9940d46132dda769c6b70160792 100644 --- a/tests/library/Class/ModelTestCase.php +++ b/tests/library/Class/ModelTestCase.php @@ -40,7 +40,7 @@ abstract class ModelTestCase extends Storm_Test_ModelTestCase { use Storm_Test_THelpers; protected - $_storm_default_to_volatile = false, + $_storm_default_to_volatile = true, $_registry_sql; @@ -57,17 +57,6 @@ abstract class ModelTestCase extends Storm_Test_ModelTestCase { } - protected function _setFindExpectation($model, $fixture, $id) { - $mock_results = $this->_buildRowset([$fixture]); - - $this->_buildTableMock($model, ['find']) - ->expects($this->once()) - ->method('find') - ->with($id) - ->will($this->returnValue($mock_results)); - } - - protected function setUp() { Storm_Model_Abstract::unsetLoaders(); if($this->_storm_default_to_volatile) { @@ -78,9 +67,27 @@ abstract class ModelTestCase extends Storm_Test_ModelTestCase { $this->_registry_sql = Zend_Registry::get('sql'); Class_Url::setBaseUrl('/bokeh'); Class_Url::setPhpMode('apache'); + + Class_AdminVar::beVolatile(); + Class_AdminVar::set('CACHE_ACTIF', 0); + Class_AdminVar::set('BIBNUM', 1); + Class_AdminVar::set('OAI_SERVER', 1); + Class_AdminVar::set('PACK_MOBILE', 1); + Class_AdminVar::set('CNIL_CONSENT_ENABLE', false); Class_AdminVar::set('NOM_DOMAINE', 'http://localhost'); + Class_AdminVar::set("AVIS_MIN_SAISIE", 0); + Class_AdminVar::set("AVIS_MAX_SAISIE", 100); + Class_AdminVar::set("FORCE_HTTPS", 0); + Class_AdminVar::set('NOM_DOMAINE', 'http://localhost'); + Class_Crypt::setPhpCommand($this->mock() + ->whenCalled('password_hash') + ->willDo(function($pass, $crypt) { return $pass; })); Class_WebService_BibNumerique_RessourceNumerique::setCommand($this->mock() ->whenCalled('execTimedScript')->answers('')); + + $this->fixture('Class_CodifLangue', + ['id' => 'fre', + 'libelle' => 'français']); } @@ -89,8 +96,8 @@ abstract class ModelTestCase extends Storm_Test_ModelTestCase { Class_Notice_Thumbnail_ResizeImage::reset(); Class_Album::setFileSystem(null); Class_FileManager::reset(); - Class_AdminVar::set('NOM_DOMAINE', ''); Class_MoteurRecherche::resetInstance(); + Class_Crypt::setPhpCommand(null); if($this->_storm_default_to_volatile) { Storm_Model_Loader::defaultToDb(); diff --git a/tests/library/Class/ModeleFusionTest.php b/tests/library/Class/ModeleFusionTest.php index aeba8cbe0dfb54f4c3f75bd44ff2cc2dc260b3fe..5d5e95c1c75bff185336bc6bdd90c03de79dda98 100644 --- a/tests/library/Class/ModeleFusionTest.php +++ b/tests/library/Class/ModeleFusionTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class ModeleFusionWithSessionActivityAndBibTest extends Storm_Test_ModelTestCase { +class ModeleFusionWithSessionActivityAndBibTest extends ModelTestCase { public function setUp() { parent::setUp(); diff --git a/tests/library/Class/NewsletterTest.php b/tests/library/Class/NewsletterTest.php index 34add2827a39948e67fd42c1866472c8b3027c5d..35e0c754c1d279cf09c5c5d6d302addae9fb7bd9 100644 --- a/tests/library/Class/NewsletterTest.php +++ b/tests/library/Class/NewsletterTest.php @@ -18,33 +18,28 @@ * along with BOKEH; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -require_once 'Class/Newsletter.php'; -require_once 'ModelTestCase.php'; - -class NewsletterFixture { - public static function nouveautesClassique() { - return array('id' => 1, - 'titre' => 'Nouveautés classique', - 'contenu' => 'Notre sélection du mois'); - } +abstract class NewsletterTestCase extends ModelTestCase { + public function setUp() { + parent::setUp(); - public static function animations() { - return array('id' => 2, - 'titre' => 'Animations', - 'contenu' => 'Pour les jeunes'); - } + $this->fixture('Class_Newsletter', + ['id' => 1, + 'titre' => 'Nouveautés classique', + 'contenu' => 'Notre sélection du mois']); - public static function all() { - return array(self::nouveautesClassique(), - self::animations()); + $this->fixture('Class_Newsletter', + ['id' => 2, + 'titre' => 'Animations', + 'contenu' => 'Pour les jeunes']); } } -class NewsletterTestFindAll extends ModelTestCase { + + +class NewsletterTestFindAll extends NewsletterTestCase { public function setUp() { parent::setUp(); - $this->_setFindAllExpectation('Class_Newsletter', NewsletterFixture::all()); $this->newsletters = Class_Newsletter::getLoader()->findAll(); } @@ -67,16 +62,14 @@ class NewsletterTestFindAll extends ModelTestCase { -class NewsletterTestFindById extends ModelTestCase { +class NewsletterTestFindById extends NewsletterTestCase { public function testFindByIdOneReturnsNouveautes() { - $this->_setFindExpectation('Class_Newsletter', NewsletterFixture::nouveautesClassique(), 1); $nouveaute = Class_Newsletter::getLoader()->find(1); $this->assertEquals(1, $nouveaute->getId()); } public function testFindByIdTwoReturnsAnimations() { - $this->_setFindExpectation('Class_Newsletter', NewsletterFixture::animations(), 2); $animations = Class_Newsletter::getLoader()->find(2); $this->assertEquals(2, $animations->getId()); } @@ -84,11 +77,10 @@ class NewsletterTestFindById extends ModelTestCase { -class NewsletterTimeSourceTest extends ModelTestCase { +class NewsletterTimeSourceTest extends NewsletterTestCase { public function setup() { parent::setup(); - $this->now = new TimeSourceForTest('2014-05-28 23:59:00'); Class_Newsletter::setTimeSource($this->now); $this->fixture('Class_Newsletter', diff --git a/tests/library/Class/Notice/ClefAlphaTest.php b/tests/library/Class/Notice/ClefAlphaTest.php index 4990e887a555faff5bdf787197b5c1d652975e94..f016c38c8ee7030f759a9690104ab70d6663dfea 100644 --- a/tests/library/Class/Notice/ClefAlphaTest.php +++ b/tests/library/Class/Notice/ClefAlphaTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class Notice_ClefAlphaSusAImprevuTest extends Storm_Test_ModelTestCase { +class Notice_ClefAlphaSusAImprevuTest extends ModelTestCase { public function setUp() { parent::setUp(); $this->_clef = new Class_Notice_ClefAlpha('SUSALIMPREVU--BOUCQF-2-LELOMBARD-2012-1'); @@ -81,7 +81,7 @@ class Notice_ClefAlphaSusAImprevuTest extends Storm_Test_ModelTestCase { -class Notice_ClefAlphaOnPseudoNoticeTest extends Storm_Test_ModelTestCase { +class Notice_ClefAlphaOnPseudoNoticeTest extends ModelTestCase { public function expectedAlphaKeysForModels() { return [ diff --git a/tests/library/Class/NoticeTest.php b/tests/library/Class/NoticeTest.php index 7cb97599006c050ffba6212443d09a8f41d31a03..b667eb73bb17cce90743dad4058fc68461291dd8 100644 --- a/tests/library/Class/NoticeTest.php +++ b/tests/library/Class/NoticeTest.php @@ -18,22 +18,6 @@ * along with BOKEH; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -require_once 'Class/Notice.php'; -require_once 'ModelTestCase.php'; - -class NoticeFixtures extends TestFixtures { - protected $_fixtures = ['millenium' => ['id_notice' => 12, - 'titres' => 'MILLENIUM'], - 'potter' => ['id_notice' => 48, - 'titres' => 'POTTER']]; - - public static function instance() { - return new self(); - } -} - - - class NoticeVignetteTest extends ModelTestCase { protected $_storm_default_to_volatile = true; @@ -422,31 +406,6 @@ class NoticeVignetteTest extends ModelTestCase { -class NoticeTestFindAll extends ModelTestCase { - public function setUp() { - parent::setUp(); - $this->_setFindAllExpectation('Class_Notice', 'NoticeFixtures'); - $this->notices = Class_Notice::getLoader()->findAll(); - } - - public function testFirstIsMillenium() { - $millenium = $this->notices[0]; - $this->assertEquals(12, $millenium->getIdNotice()); - $this->assertEquals(12, $millenium->getId()); - $this->assertEquals('MILLENIUM', $millenium->getTitres()); - } - - public function testSecondPotter() { - $potter = $this->notices[1]; - $this->assertEquals(48, $potter->getIdNotice()); - $this->assertEquals(48, $potter->getId()); - $this->assertEquals('POTTER', $potter->getTitres()); - } -} - - - - class NoticeTestTypeDoc extends ModelTestCase { public function setUp() { parent::setUp(); @@ -609,7 +568,7 @@ class NoticeTestTranslator extends ModelTestCase { -abstract class NoticeThirdPartyTracksTestCase extends Storm_Test_ModelTestCase { +abstract class NoticeThirdPartyTracksTestCase extends ModelTestCase { protected $_tracks, $_result; public function setUp() { @@ -745,7 +704,7 @@ class NoticeGamTest extends NoticeThirdPartyTracksTestCase { -class NoticeStromaeTest extends Storm_Test_ModelTestCase { +class NoticeStromaeTest extends ModelTestCase { protected $_tracks, $_output, $_temp_file, $_direcrectory_definition_length; public function setUp() { @@ -946,7 +905,7 @@ class NoticeWithSerialArticleTest extends AbstractControllerTestCase { -class NoticeGetChampNoticeTest extends Storm_Test_ModelTestCase { +class NoticeGetChampNoticeTest extends ModelTestCase { protected $_storm_default_to_volatile = true, $_record, $_facets; diff --git a/tests/library/Class/PanierNoticeTest.php b/tests/library/Class/PanierNoticeTest.php index bee262b2c6110c983690cf76b3f5d88f030e24f0..aff31c8a0793ff30f5d9f73fe6e63220bb022605 100644 --- a/tests/library/Class/PanierNoticeTest.php +++ b/tests/library/Class/PanierNoticeTest.php @@ -18,9 +18,11 @@ * along with BOKEH; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -require_once 'ModelTestCase.php'; class PanierNoticeLoaderTestFindAllBelongsToAdmin extends ModelTestCase { + protected + $_storm_default_to_volatile = false; + public function setUp() { parent::setUp(); @@ -46,6 +48,7 @@ class PanierNoticeLoaderTestFindAllBelongsToAdmin extends ModelTestCase { $this->paniers = Class_PanierNotice::getLoader()->findAllBelongsToAdmin(); } + public function testQuery() { $this->assertEquals("SELECT `notices_paniers`.*, `bib_admin_users`.* FROM `notices_paniers`\n ". "INNER JOIN `bib_admin_users` ON notices_paniers.id_user = bib_admin_users.id_user WHERE (bib_admin_users.ROLE_LEVEL >= 3) ORDER BY `notices_paniers`.`libelle` ASC", @@ -244,17 +247,15 @@ class PanierNoticeWithThreeNoticesTest extends ModelTestCase { -class PanierNoticeAssociatedToCatalogueTest extends Storm_Test_ModelTestCase { +class PanierNoticeAssociatedToCatalogueTest extends ModelTestCase { protected $_fictions, $_catalogue_films, - $_assoc_fictions_films, - $_catalogue_cinema, - $_old_sql; + $_catalogue_cinema; public function setUp() { parent::setUp(); - $this->_old_sql = Zend_Registry::get('sql'); + Zend_Registry::set('sql', $this->mock() ->whenCalled('query')->answers(true)); @@ -268,17 +269,7 @@ class PanierNoticeAssociatedToCatalogueTest extends Storm_Test_ModelTestCase { $this->_fictions->setCatalogues([$this->_catalogue_films])->save(); - $this->_catalogue_cinema->setSousDomaines([$this->_catalogue_films]); - - $this->_assoc_fictions_films = $this->fixture('Class_PanierNoticeCatalogue', ['id' =>19, - 'id_panier' => 4, - 'id_catalogue' => 6]); - } - - - public function tearDown() { - Zend_Registry::set('sql', $this->_old_sql); - parent::tearDown(); + $this->_catalogue_cinema->setSousDomaines([$this->_catalogue_films])->save(); } @@ -290,6 +281,7 @@ class PanierNoticeAssociatedToCatalogueTest extends Storm_Test_ModelTestCase { /** @test */ public function catalogueFilmsShouldHavePanierFictions() { + $paniers = $this->_catalogue_films->getPanierNotices(); $this->assertEquals([$this->_fictions], $this->_catalogue_films->getPanierNotices()); } @@ -316,7 +308,7 @@ class PanierNoticeAssociatedToCatalogueTest extends Storm_Test_ModelTestCase { -class NewPanierNoticeForUserTest extends Storm_Test_ModelTestCase { +class NewPanierNoticeForUserTest extends ModelTestCase { public function setUp() { parent::setUp(); $this->tom = $this->fixture('Class_Users', ['id'=>4, diff --git a/tests/library/Class/Profil/SkinTest.php b/tests/library/Class/Profil/SkinTest.php index 98ddd089603b51bd2365dddd0b43874e2d84c285..9214c2ae32596fd9603438b1edba86210c71f369 100644 --- a/tests/library/Class/Profil/SkinTest.php +++ b/tests/library/Class/Profil/SkinTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -abstract class Class_Profil_SkinTestCase extends Storm_Test_ModelTestCase { +abstract class Class_Profil_SkinTestCase extends ModelTestCase { protected $_skin; protected $_file_system; protected $_skin_name = 'testing'; diff --git a/tests/library/Class/Profil/SkinUpdateReaderTest.php b/tests/library/Class/Profil/SkinUpdateReaderTest.php index e9c2085dbdab125a391ed418bf9003d34b219bf0..2d9cd1fa7bc8937ecf0e77fbc5de42a77824d79b 100644 --- a/tests/library/Class/Profil/SkinUpdateReaderTest.php +++ b/tests/library/Class/Profil/SkinUpdateReaderTest.php @@ -20,7 +20,7 @@ */ -class Class_SkinUpdateReaderTest extends Storm_Test_ModelTestCase { +class Class_SkinUpdateReaderTest extends ModelTestCase { protected $_reader; public function setUp() { diff --git a/tests/library/Class/RemoteClientTest.php b/tests/library/Class/RemoteClientTest.php index 601285b97dfe92c2aa12c8dc00c328a77759bcda..d7b1f1be2d1245edfc167b809221078489abb0b7 100644 --- a/tests/library/Class/RemoteClientTest.php +++ b/tests/library/Class/RemoteClientTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class RemoteClientIpAddressTest extends Storm_Test_ModelTestCase { +class RemoteClientIpAddressTest extends ModelTestCase { public function setUp() { parent::setUp(); $this->_SERVER_BAK = $_SERVER; diff --git a/tests/library/Class/ScriptLoaderTest.php b/tests/library/Class/ScriptLoaderTest.php index 8683dc97a21dc848478d2b4216f65196e6711818..53e90213d7ea44fd7cf543ef4b2c342f89bfdc3c 100644 --- a/tests/library/Class/ScriptLoaderTest.php +++ b/tests/library/Class/ScriptLoaderTest.php @@ -240,7 +240,7 @@ class ScriptLoaderVersionHashTest extends PHPUnit_Framework_TestCase { -class ScriptLoaderNotificationsBarTest extends Storm_Test_ModelTestCase { +class ScriptLoaderNotificationsBarTest extends ModelTestCase { public function setUp() { Class_ScriptLoader::resetInstance(); $messenger = new ZendAfi_Controller_Action_Helper_FlashMessenger(); diff --git a/tests/library/Class/SitothequeTest.php b/tests/library/Class/SitothequeTest.php index e7b008a40ac121cd43e72a2aca044ede9bde530c..686b80aa3cf375f96d83f879b800f61fdacbd832 100644 --- a/tests/library/Class/SitothequeTest.php +++ b/tests/library/Class/SitothequeTest.php @@ -18,7 +18,7 @@ * along with BOKEH; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class SitothequeSitesFromIdsAndCategoriesTest extends Storm_Test_ModelTestCase { +class SitothequeSitesFromIdsAndCategoriesTest extends ModelTestCase { /** @test */ function getSitesFromIdAndCategoriesShouldReturnFeeds() { $site_premiere = Class_Sitotheque::getLoader()->newInstanceWithId(26); diff --git a/tests/library/Class/StatsNoticesTest.php b/tests/library/Class/StatsNoticesTest.php index eff40751cb9dd7ba8010ccd9386ba6626453cb15..535118092264876371a54772a3f81840a73a5107 100644 --- a/tests/library/Class/StatsNoticesTest.php +++ b/tests/library/Class/StatsNoticesTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class Class_StatsNoticesTest extends Storm_Test_ModelTestCase { +class Class_StatsNoticesTest extends ModelTestCase { protected $_model; protected $_registry_sql; protected $_sql; diff --git a/tests/library/Class/SuggestionAchatTest.php b/tests/library/Class/SuggestionAchatTest.php index c9b5d4a9a211e75031c043bf0eba158b6d26fe41..546515c74da70fcb3b95e1aeef269e3d1db1296f 100644 --- a/tests/library/Class/SuggestionAchatTest.php +++ b/tests/library/Class/SuggestionAchatTest.php @@ -20,7 +20,7 @@ */ -abstract class SuggestionAchatTestCase extends Storm_Test_ModelTestCase { +abstract class SuggestionAchatTestCase extends ModelTestCase { protected $_mock_transport; protected $_suggestion; diff --git a/tests/library/Class/Systeme/ModulesMenu/NumilogTest.php b/tests/library/Class/Systeme/ModulesMenu/NumilogTest.php index 1d89e0e1a26f98aad4ef5d3b3603905c0aa2ab46..99b397cb88f392770bdaf47d55683fa26b935363 100644 --- a/tests/library/Class/Systeme/ModulesMenu/NumilogTest.php +++ b/tests/library/Class/Systeme/ModulesMenu/NumilogTest.php @@ -20,7 +20,7 @@ */ -class Class_Systeme_ModulesMenu_NumilogTest extends Storm_Test_ModelTestCase { +class Class_Systeme_ModulesMenu_NumilogTest extends ModelTestCase { public function setUp() { parent::setUp(); RessourcesNumeriquesFixtures::activate(); diff --git a/tests/library/Class/Systeme/ModulesMenu/VodeclicTest.php b/tests/library/Class/Systeme/ModulesMenu/VodeclicTest.php index 3dccd2fdb48b87c456b442a9d59b87e6726113c8..4215da2cfd3e0bd174a75f8d84b613933058c59d 100644 --- a/tests/library/Class/Systeme/ModulesMenu/VodeclicTest.php +++ b/tests/library/Class/Systeme/ModulesMenu/VodeclicTest.php @@ -20,7 +20,7 @@ */ -class Class_Systeme_ModulesMenu_VodeclicTest extends Storm_Test_ModelTestCase { +class Class_Systeme_ModulesMenu_VodeclicTest extends ModelTestCase { public function setUp() { parent::setUp(); RessourcesNumeriquesFixtures::activate(); diff --git a/tests/library/Class/Systeme/ModulesMenuTest.php b/tests/library/Class/Systeme/ModulesMenuTest.php index 524278f1472e58e32f8846d6e4ea6759e051b227..878f52b6bddcfe148236af995e11c53e3a125ee6 100644 --- a/tests/library/Class/Systeme/ModulesMenuTest.php +++ b/tests/library/Class/Systeme/ModulesMenuTest.php @@ -21,7 +21,7 @@ include_once('tests/fixtures/RessourcesNumeriquesFixtures.php'); -abstract class ModulesMenuBibNumeriqueTestCase extends Storm_Test_ModelTestCase { +abstract class ModulesMenuBibNumeriqueTestCase extends ModelTestCase { public function availableServices() { return [ ['VODECLIC', 'Vodeclic'], @@ -111,7 +111,7 @@ class ModulesMenuBibNumeriqueDeactivatedComboTest extends ModulesMenuBibNumeriqu -class ModulesMenuTest extends Storm_Test_ModelTestCase { +class ModulesMenuTest extends ModelTestCase { public function setUp() { parent::setUp(); Zend_Controller_Front::getInstance() diff --git a/tests/library/Class/Systeme/PergameServiceTest.php b/tests/library/Class/Systeme/PergameServiceTest.php index 37d957a4cdf7f77b7f12fd63230c499d7bdde366..fcb174660a7091ce0279ef54bb71d76b5da2fddf 100644 --- a/tests/library/Class/Systeme/PergameServiceTest.php +++ b/tests/library/Class/Systeme/PergameServiceTest.php @@ -149,7 +149,7 @@ class PergameServiceRegleReservationTest extends PergameServiceTestCase { -class PergameServiceReserverExemplaireValidationsTest extends Storm_Test_ModelTestCase { +class PergameServiceReserverExemplaireValidationsTest extends ModelTestCase { public function userValidationDatas() { return [ [null, 'Vous devez être connecté'], @@ -191,10 +191,11 @@ class PergameServiceReserverExemplaireValidationsTest extends Storm_Test_ModelTe } -abstract class PergameServiceReserverExemplaireValidUserTestCase extends Storm_Test_ModelTestCase { + + +abstract class PergameServiceReserverExemplaireValidUserTestCase extends ModelTestCase { public function setUp() { parent::setUp(); - Class_Reservation::beVolatile(); Class_Reservation::setTimeSource(new TimeSourceForTest('2015-20-05 12:30:00')); $this->user = $this->fixture('Class_Users', [ @@ -205,15 +206,19 @@ abstract class PergameServiceReserverExemplaireValidUserTestCase extends Storm_T 'ordreabon' => 0 ]); - $this->fixture('Class_TypeDoc', [ - 'id' => 6, - 'label' => 'Bluray', - 'codif_type_doc' => $this->fixture('Class_CodifTypeDoc', [ - 'id' => 6, - 'type_doc_id' => 6, - 'famille_id' => 4 - ]) - ]); + $this->fixture('Class_CosmoVar', + ['id' => 'types_docs', + 'array_as_list' => ['0' => 'non identifié', + '1' => 'Livres', + '2' => 'Revues et journaux', + '3' => 'Musique', + '6' => 'Bluray']]); + + $this->fixture('Class_CodifTypeDoc', [ + 'id' => 6, + 'type_doc_id' => 6, + 'famille_id' => 4 + ]); $this->item = $this->fixture('Class_Exemplaire', [ 'id' => 12, @@ -225,8 +230,6 @@ abstract class PergameServiceReserverExemplaireValidUserTestCase extends Storm_T ]) ]); - Class_Transaction::beVolatile(); - $this->time_source = new PergameServiceTestingTimeSource(); Class_Systeme_PergameService::setTimeSource($this->time_source); diff --git a/tests/library/Class/UserGroupCategorieTest.php b/tests/library/Class/UserGroupCategorieTest.php index 0b45b593e1be230c4918526d83b9aa65163cc6c1..4bfb484a6b46296d3c651b30b8f0aada8601f87c 100644 --- a/tests/library/Class/UserGroupCategorieTest.php +++ b/tests/library/Class/UserGroupCategorieTest.php @@ -16,10 +16,10 @@ * * 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 UserGroupCategorieWithNoGroupTest extends Storm_Test_ModelTestCase { +class UserGroupCategorieWithNoGroupTest extends ModelTestCase { protected $_association; protected $_etablissement; @@ -54,7 +54,7 @@ class UserGroupCategorieWithNoGroupTest extends Storm_Test_ModelTestCase { $this->assertEquals($this->_association->getParentCategorie(), $this->_etablissement); } - + /** @test **/ public function etablissementShouldHaveSousCategorieAssociation() { $this->assertEquals([$this->_association], $this->_etablissement->getSousCategories()); diff --git a/tests/library/Class/UserGroupTest.php b/tests/library/Class/UserGroupTest.php index 63a8ba876218402afbdd6a155befb11a39a5ef9c..4f9ca0f3b92217392ced2a6c7fa44a9a7a2ebf79 100644 --- a/tests/library/Class/UserGroupTest.php +++ b/tests/library/Class/UserGroupTest.php @@ -18,7 +18,7 @@ * along with BOKEH; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -abstract class UserGroupsTestCase extends Storm_Test_ModelTestCase { +abstract class UserGroupsTestCase extends ModelTestCase { public function setUp() { parent::setUp(); diff --git a/tests/library/Class/UsersTest.php b/tests/library/Class/UsersTest.php index cf88fb197a4178d10983f100e30b2d8b585867a9..0e8c278a66950458461d50dc0e0cf3a47d7540a7 100644 --- a/tests/library/Class/UsersTest.php +++ b/tests/library/Class/UsersTest.php @@ -19,284 +19,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class UserFixtures { - public static function miles() { - return array('ID_USER' => 1, - 'LOGIN' => 'mdavis', - 'ROLE' => 'abonne_sigb', - 'ROLE_LEVEL' => 2, - 'PASSWORD' => 'nifniff', - 'ID_SITE' => 1, - 'NOM' => 'Davis', - 'PRENOM' => 'Miles', - 'DATE_FIN' => '2025-04-26'); - } - - public static function truffaz() { - return array('ID_USER' => 34, - 'LOGIN' => 'etruffaz', - 'ROLE' => 'invite', - 'ROLE_LEVEL' => 0, - 'PASSWORD' => 'nafnaf', - 'ID_SITE' => 1, - 'NOM' => 'Truffaz', - 'PRENOM' => 'Erik', - 'DATE_FIN' => '2001-10-23'); - } - - public static function all() { - return array(self::miles(), - self::truffaz()); - } -} - - - -class UsersTestLoader extends PHPUnit_Framework_TestCase { - - public function testIdFieldIsID_USER() { - $loader = Class_Users::getLoader(); - $this->assertEquals('id_user', $loader->getIdField()); - } -} - - - -class UsersMilesDavisAttributesTest extends PHPUnit_Framework_TestCase { - public function setUp() { - parent::setUp(); - $this->miles = Class_Users::getLoader()->newFromRow(UserFixtures::miles()); - } - - public function testID_USER() { - $this->assertEquals(1, $this->miles->ID_USER); - } - - public function testNOM() { - $this->assertEquals('Davis', $this->miles->NOM); - } - - public function testPRENOM() { - $this->assertEquals('Miles', $this->miles->PRENOM); - } - - - /** @test */ - public function idSigbShouldDefaultToEmpty() { - $this->assertEquals('', $this->miles->getIdSigb()); - } - - public function testSetPRENOM() { - $this->miles->PRENOM = 'Miles Dewey'; - $this->assertEquals('Miles Dewey', $this->miles->PRENOM); - $this->assertEquals('Miles Dewey', $this->miles->getPrenom()); - } - - public function testSetNOM() { - $this->miles->NOM = 'DAVIS'; - $this->assertEquals('DAVIS', $this->miles->NOM); - $this->assertEquals('DAVIS', $this->miles->getNom()); - } - - public function testSetID() { - $this->miles->ID = 25; - $this->assertEquals(25, $this->miles->ID_USER); - $this->assertEquals(25, $this->miles->getId()); - } - - public function testGetUnknownFieldReturnsNull() { - $this->assertEquals(null, $this->miles->INEXISTANT); - } - - public function testSetUnknownFieldCreatesIt() { - $this->miles->INEXISTANT = 12; - $this->assertEquals(12, $this->miles->INEXISTANT); - $this->assertEquals(12, $this->miles->getInexistant()); - } - - /** @test */ - function abonnementShouldBeValid() { - $this->assertTrue($this->miles->isAbonnementValid()); - } - -} - - - - -class UsersErikTruffazAttributesTest extends PHPUnit_Framework_TestCase { - public function setUp() { - parent::setUp(); - $this->truffaz = Class_Users::getLoader()->newFromRow(UserFixtures::truffaz()); - } - - - /** @test */ - function abonnementShouldNotBeValid() { - $this->assertFalse($this->truffaz->isAbonnementValid()); - } -} - - - - -class UsersFindAllTest extends ModelTestCase { - public function setUp() { - parent::setUp(); - $this->_setFindAllExpectation('Class_Users', UserFixtures::all()); - $this->users = Class_Users::getLoader()->findAll(); - } - - public function testFirstIsDavis() { - $davis = $this->users[0]; - $this->assertEquals(1, $davis->getId()); - $this->assertEquals('Davis', $davis->getNom()); - $this->assertEquals('Miles', $davis->getPrenom()); - } - - public function testSecondIsTruffaz() { - $truffaz = $this->users[1]; - $this->assertEquals(34, $truffaz->getId()); - $this->assertEquals('Truffaz', $truffaz->getNom()); - $this->assertEquals('Erik', $truffaz->getPrenom()); - } -} - - - - -class UsersFindByIdTest extends ModelTestCase { - public function testFindByIdOneReturnsMiles() { - $this->_setFindExpectation('Class_Users', UserFixtures::miles(), 1); - $miles = Class_Users::getLoader()->find(1); - $this->assertEquals(1, $miles->getId()); - $this->assertEquals('Davis', $miles->getNom()); - } - - public function testFindByIdThirtyFourReturnsTruffaz() { - $this->_setFindExpectation('Class_Users', UserFixtures::truffaz(), 34); - $truffaz = Class_Users::getLoader()->find(34); - $this->assertEquals(34, $truffaz->getId()); - $this->assertEquals('Truffaz', $truffaz->getNom()); - } - -} - - - - -class UsersSaveTest extends ModelTestCase { - - protected $_storm_default_to_volatile = true; - - - /** @test */ - public function saveNewUser() { - $new_user = Class_Users::newInstance(['nom' => 'Coltrane', - 'prenom' => 'John', - 'login' => 'jcoltrane', - 'password' => 'giantsteps', - 'role_level' => 2, - 'id_site' => 1, - 'role' => 'abonne_sigb', - 'idabon' => '1234', - 'date_fin' => '', - 'naissance' => '', - 'date_debut' => '', - 'telephone' => '', - 'mail' => '', - 'adresse' => '', - 'code_postal' => '', - 'ville' => '', - 'id_sigb' => null, - 'is_contact_sms' => 0, - 'is_contact_mail' => 0, - 'date_maj' => '2013-10-23 11:47:38', - 'mobile' => '', - 'civilite' => 0, - 'ordreabon' => '', - 'id_panier_courant' => 0, - 'pseudo' => '', - 'settings' => '', - 'statut' => 0]); - - $new_user->save(); - $this->assertEquals(1, $new_user->getId()); - $this->assertEquals(1234, $new_user->getIdabon()); - } - - - /** @test */ - public function saveExistingUser() { - $user = $this->fixture('Class_Users', - ['id' => 189, - 'nom' => 'Truffaz', - 'prenom' => 'Erik', - 'login' => 'etruffaz', - 'role' => 'invite', - 'role_level' => 0, - 'password' => 'nafnaf', - 'id_site' => 1, - 'mail' => 'erik@truffaz.com', - 'id_user' => 34, - 'date_fin' => '2001-10-23', - 'idabon' => '', - 'naissance' => '', - 'date_debut' => '', - 'telephone' => '', - 'adresse' => '', - 'code_postal' => '', - 'ville' => '', - 'id_sigb' => null, - 'is_contact_sms' => 0, - 'is_contact_mail' => 0, - 'date_maj' => '2013-10-23 11:47:38', - 'mobile' => '', - 'civilite' => 0, - 'ordreabon' => '', - 'id_panier_courant' => 0, - 'pseudo' => '', - 'settings' => '', - 'statut' => 0]); - - $user->setMail('erik@truffaz.com')->save(); - $this->assertEquals('erik@truffaz.com', Class_Users::find(189)->getMail()); - } -} - - - - -class UsersDeleteTest extends ModelTestCase { - protected $_storm_default_to_volatile = true; - - - - /** @test */ - public function deleteMilesShouldDeleteId1() { - $miles = $this->fixture('Class_Users', - array_merge(['id' => 1, - 'idabon' => 789], - UserFixtures::miles())); - Class_Users::find(1)->delete(); - $this->assertNull(Class_Users::find(1)); - } - - - /** @test */ - public function deleteTruffazShouldDeleteWithId34() { - $truffaz = $this->fixture('Class_Users', - array_merge(['id' => 34, - 'idabon' => 734], - UserFixtures::truffaz())); - Class_Users::find(34)->delete(); - $this->assertNull(Class_Users::find(34)); - } -} - - - - class UsersTestAssociations extends ModelTestCase { protected $_storm_default_to_volatile = true; @@ -476,7 +198,7 @@ class UsersAgeTest extends ModelTestCase { -abstract class UsersMailingActionTestCase extends Storm_Test_ModelTestCase { +abstract class UsersMailingActionTestCase extends ModelTestCase { protected $mock_transport, $user; public function setUp() { @@ -766,7 +488,7 @@ class UsersFicheAbonneTest extends ModelTestCase { -class UsersGetIdentityWithSessionErrorTest extends Storm_Test_ModelTestCase { +class UsersGetIdentityWithSessionErrorTest extends ModelTestCase { /** @test */ public function getIdentityShouldReturnNullOnZendSessionException() { ZendAfi_Auth::setInstance(Storm_Test_ObjectWrapper::mock() @@ -865,6 +587,11 @@ class UsersWithLoginThroughSigbOnlyTest extends ModelTestCase { protected $_storm_default_to_volatile = true; + public function setUp() { + parent::setUp(); + Class_Crypt::setPhpCommand(null); + } + /** @test */ public function borrowerPasswordShouldBeEmpty() { diff --git a/tests/library/Class/VodeclicLinkTest.php b/tests/library/Class/VodeclicLinkTest.php index 1bf5fbe4099046bbb04f08484db3bd89196e9207..3552818b5084dd45a77e641ecd5d8edd5e725c4a 100644 --- a/tests/library/Class/VodeclicLinkTest.php +++ b/tests/library/Class/VodeclicLinkTest.php @@ -16,10 +16,10 @@ * * 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 */ -abstract class VodeclicLinkTestCase extends Storm_Test_ModelTestCase { +abstract class VodeclicLinkTestCase extends ModelTestCase { public function setUp() { parent::setUp(); Class_AdminVar::newInstanceWithId('VODECLIC_KEY', ['valeur' => '2m5js1dPpFNrtAJbsfX1']); @@ -51,7 +51,7 @@ class VodeclicLinkWithAbonTest extends VodeclicLinkTestCase { /** @test */ public function urlForJeanShouldBeBiblioSSO() { - $this->assertEquals('https://biblio.vodeclic.com/auth/biblio/sso', + $this->assertEquals('https://biblio.vodeclic.com/auth/biblio/sso', $this->_vodeclic->baseUrl()); } @@ -67,7 +67,7 @@ class VodeclicLinkWithAbonTest extends VodeclicLinkTestCase { 'prenom=Jean&'. 'bib_id=543', $this->encrypted_id, - $this->encrypted_date), + $this->encrypted_date), $this->_vodeclic->url()); } @@ -82,7 +82,7 @@ class VodeclicLinkWithAbonTest extends VodeclicLinkTestCase { 'partenaire=bonlieu&'. 'bib_id=543', $this->encrypted_id, - $this->encrypted_date), + $this->encrypted_date), $this->_vodeclic->url()); } } diff --git a/tests/library/Class/WebService/Album/VignetteTest.php b/tests/library/Class/WebService/Album/VignetteTest.php index 648f3a3511b6124c6718ef81ba5df8d4f3d260c8..ce93a68cda68a5d46e0e7902ecf698e662260991 100644 --- a/tests/library/Class/WebService/Album/VignetteTest.php +++ b/tests/library/Class/WebService/Album/VignetteTest.php @@ -16,10 +16,10 @@ * * 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 */ -abstract class Class_WebService_Album_VignetteTestCase extends Storm_Test_ModelTestCase { +abstract class Class_WebService_Album_VignetteTestCase extends ModelTestCase { protected $_vignette, $_http_client; public function setUp() { @@ -68,8 +68,8 @@ abstract class Class_WebService_Album_VignetteBlancheNeigeTestCase extends Class Class_Album::newInstanceWithId(45) ->setTitre('Blanche Neige') ->beArteVOD() - ->setNotes([['field' => '856', - 'data' => ['x' => 'poster', + ->setNotes([['field' => '856', + 'data' => ['x' => 'poster', 'a' => 'http://mediatheque.com/blanche_neige.jpg']]])); @@ -155,7 +155,7 @@ class Class_WebService_Album_VignetteBlancheNeigeTest extends Class_WebService_A /** @test */ public function albumUploadMoverShouldBeAnInstanceOfClass_UploadMover_LocalFile() { - $this->assertInstanceOf('Class_UploadMover_LocalFile', + $this->assertInstanceOf('Class_UploadMover_LocalFile', $this->_album->getUploadHandler('fichier')->getUploadMover()); } } @@ -167,8 +167,8 @@ class Class_WebService_Album_VignetteBlancheNeigeErrorsTest extends Class_WebSer /** @test */ public function withoutValidUrlShouldNotDownloadImage() { $this->_album - ->setNotes([['field' => '856', - 'data' => ['x' => 'poster', + ->setNotes([['field' => '856', + 'data' => ['x' => 'poster', 'a' => 'zork']]]); $this->_vignette->updateAlbum($this->_album); $this->assertFalse($this->_http_client->methodHasBeenCalled('open_url')); diff --git a/tests/library/Class/WebService/CyberlibrisTest.php b/tests/library/Class/WebService/CyberlibrisTest.php index 59d60fce4b7ba7f565741703aafe2f8f9c4af5a7..8cc7d282fd6b2af6b569590d5a6529176054b2eb 100644 --- a/tests/library/Class/WebService/CyberlibrisTest.php +++ b/tests/library/Class/WebService/CyberlibrisTest.php @@ -100,7 +100,7 @@ class CyberlibrisHarvestSaveTest extends ModelTestCase { -class CyberlibrisIncTest extends Storm_Test_ModelTestCase { +class CyberlibrisIncTest extends ModelTestCase { public function tearDown() { Storm_Model_Loader::defaultToDb(); parent::tearDown(); diff --git a/tests/library/Class/WebService/MappedSoapClientTest.php b/tests/library/Class/WebService/MappedSoapClientTest.php index dfc4793b9e5e36c37abafa3648de35b6ba3dc17f..23a57fc011563026925b985a6491a5611426b017 100644 --- a/tests/library/Class/WebService/MappedSoapClientTest.php +++ b/tests/library/Class/WebService/MappedSoapClientTest.php @@ -20,7 +20,7 @@ */ -abstract class MappedSoapClientTestCase extends Storm_Test_ModelTestCase { +abstract class MappedSoapClientTestCase extends ModelTestCase { protected $_soap_client; public function setUp() { diff --git a/tests/library/Class/WebService/NumeriquePremiumTest.php b/tests/library/Class/WebService/NumeriquePremiumTest.php index 2ba2390dd768174d85ff8b673a64be41f3a9e4c7..0b9d45f6caecaf4e341b9137aba0e35cb1b7f482 100644 --- a/tests/library/Class/WebService/NumeriquePremiumTest.php +++ b/tests/library/Class/WebService/NumeriquePremiumTest.php @@ -20,7 +20,7 @@ */ -class Class_WebService_NumeriquePremiumHarvestTest extends Storm_Test_ModelTestCase { +class Class_WebService_NumeriquePremiumHarvestTest extends ModelTestCase { public function setUp() { parent::setUp(); diff --git a/tests/library/Class/WebService/Orphea/CatalogueParserTest.php b/tests/library/Class/WebService/Orphea/CatalogueParserTest.php index f4b2b0fa98c18870ba9f28fb517af5135838cec1..1e7221f8e768a7923a31246ac8088f12d7980652 100644 --- a/tests/library/Class/WebService/Orphea/CatalogueParserTest.php +++ b/tests/library/Class/WebService/Orphea/CatalogueParserTest.php @@ -21,7 +21,7 @@ include_once('tests/fixtures/HarvestOrpheaFixtures.php'); -class CatalogueParserOrpheaTest extends Storm_Test_ModelTestCase { +class CatalogueParserOrpheaTest extends ModelTestCase { public function setUp() { parent::setUp(); $this->_parser = new Class_WebService_BibNumerique_Orphea_CatalogueParser(); @@ -36,7 +36,7 @@ class CatalogueParserOrpheaTest extends Storm_Test_ModelTestCase { -class CatalogueParserMetaDatasTest extends Storm_Test_ModelTestCase { +class CatalogueParserMetaDatasTest extends ModelTestCase { public function tearDown() { Storm_Model_Loader::defaultToDb(); parent::tearDown(); @@ -59,7 +59,7 @@ class CatalogueParserMetaDatasTest extends Storm_Test_ModelTestCase { -class CatalogueParserAssetsUrlTest extends Storm_Test_ModelTestCase { +class CatalogueParserAssetsUrlTest extends ModelTestCase { public function tearDown() { Storm_Model_Loader::defaultToDb(); parent::tearDown(); diff --git a/tests/library/Class/WebService/SIGB/BiblixNetTest.php b/tests/library/Class/WebService/SIGB/BiblixNetTest.php index cfa2e491153dbbb84769f1645f14e8ecb03861ce..4a043dd5a483af08d0b4950b937a859024ae5feb 100644 --- a/tests/library/Class/WebService/SIGB/BiblixNetTest.php +++ b/tests/library/Class/WebService/SIGB/BiblixNetTest.php @@ -21,7 +21,7 @@ require_once('BiblixNetFixtures.php'); -class BiblixNetGetServiceTest extends Storm_Test_ModelTestCase { +class BiblixNetGetServiceTest extends ModelTestCase { public function setUp() { parent::setUp(); Class_WebService_SIGB_BiblixNet::reset(); @@ -46,7 +46,7 @@ class BiblixNetGetServiceTest extends Storm_Test_ModelTestCase { -abstract class BiblixNetTestCase extends Storm_Test_ModelTestCase { +abstract class BiblixNetTestCase extends ModelTestCase { /** @var PHPUnit_Framework_MockObject_MockObject */ protected $_mock_web_client; diff --git a/tests/library/Class/WebService/SIGB/CarthameTest.php b/tests/library/Class/WebService/SIGB/CarthameTest.php index 91100a3aa05280091a7d37fb39173b28dfa4c455..9b4ad4c50910fff8805ec18d05ff72cb2ebfd2f6 100644 --- a/tests/library/Class/WebService/SIGB/CarthameTest.php +++ b/tests/library/Class/WebService/SIGB/CarthameTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -abstract class CarthameTestCase extends Storm_Test_ModelTestCase { +abstract class CarthameTestCase extends ModelTestCase { protected $mock_web_client; protected $service; diff --git a/tests/library/Class/WebService/SIGB/CdScriptTest.php b/tests/library/Class/WebService/SIGB/CdScriptTest.php index 3b52b876b949da34dab195815247d1ec7bc1756e..ba940d8ecda1c91c73c9ce8038119c4adfc6303a 100644 --- a/tests/library/Class/WebService/SIGB/CdScriptTest.php +++ b/tests/library/Class/WebService/SIGB/CdScriptTest.php @@ -20,7 +20,7 @@ */ -abstract class CdScriptTestCase extends Storm_Test_ModelTestCase { +abstract class CdScriptTestCase extends ModelTestCase { protected $_service; public function setUp() { diff --git a/tests/library/Class/WebService/SIGB/EmpruntTest.php b/tests/library/Class/WebService/SIGB/EmpruntTest.php index 3365a58f08b7cc104ec50b80f9bbeaca16c60362..58c1e1153f1c9c48c43559ef9963870c1267ab33 100644 --- a/tests/library/Class/WebService/SIGB/EmpruntTest.php +++ b/tests/library/Class/WebService/SIGB/EmpruntTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class WebServiceSIGBEmpruntTest extends Storm_Test_ModelTestCase { +class WebServiceSIGBEmpruntTest extends ModelTestCase { /** @test */ public function empruntShouldNotBeRetardWithDateRetourToday() { $emprunt = Class_WebService_SIGB_Emprunt::newInstanceWithEmptyExemplaire() diff --git a/tests/library/Class/WebService/SIGB/ExemplaireTest.php b/tests/library/Class/WebService/SIGB/ExemplaireTest.php index f07bacabb1558db2a4242c1c908412c5ff7040ec..5124a52a1cb2b61969f33387cb845650cd1527db 100644 --- a/tests/library/Class/WebService/SIGB/ExemplaireTest.php +++ b/tests/library/Class/WebService/SIGB/ExemplaireTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class ExemplaireSIGBTest extends Storm_Test_ModelTestCase { +class ExemplaireSIGBTest extends ModelTestCase { public function setUp() { parent::setUp(); Class_Profil::setCurrentProfil($this->fixture('Class_Profil', @@ -53,7 +53,7 @@ class ExemplaireSIGBTest extends Storm_Test_ModelTestCase { -class ExemplaireWithMultipleItemsTest extends Storm_Test_ModelTestCase { +class ExemplaireWithMultipleItemsTest extends ModelTestCase { protected $_storm_default_to_volatile = true; @@ -107,7 +107,7 @@ class ExemplaireWithMultipleItemsTest extends Storm_Test_ModelTestCase { -class ExemplaireWithMultipleItemsAndSameIdOrigineTest extends Storm_Test_ModelTestCase { +class ExemplaireWithMultipleItemsAndSameIdOrigineTest extends ModelTestCase { protected $_storm_default_to_volatile = true; public function setUp() { diff --git a/tests/library/Class/WebService/SIGB/MicrobibServiceTest.php b/tests/library/Class/WebService/SIGB/MicrobibServiceTest.php index 8c5ef82bf7cb896ba4eb4a60356e6a517034811c..b04fb8d0ac1ae894ae6e56f7e59812c29c68c651 100644 --- a/tests/library/Class/WebService/SIGB/MicrobibServiceTest.php +++ b/tests/library/Class/WebService/SIGB/MicrobibServiceTest.php @@ -20,7 +20,7 @@ */ include_once('MicrobibFixtures.php'); -abstract class MicrobibServiceTestCase extends Storm_Test_ModelTestCase { +abstract class MicrobibServiceTestCase extends ModelTestCase { protected $_storm_default_to_volatile = true; protected $_search_client; protected $_microbib; diff --git a/tests/library/Class/WebService/SIGB/PMBTest.php b/tests/library/Class/WebService/SIGB/PMBTest.php index c428791932cc8d34c1e1196ca10cfb751023c432..9e3b1c2e2783240055a2e2ed82153f33685aa2ff 100644 --- a/tests/library/Class/WebService/SIGB/PMBTest.php +++ b/tests/library/Class/WebService/SIGB/PMBTest.php @@ -20,7 +20,7 @@ */ require_once 'tests/fixtures/PmbFixtures.php'; -abstract class PMBTestCase extends Storm_Test_ModelTestCase { +abstract class PMBTestCase extends ModelTestCase { protected $_service; public function setUp() { diff --git a/tests/library/Class/WebService/SIGB/VSmartTest.php b/tests/library/Class/WebService/SIGB/VSmartTest.php index 07a848b755e0a6e94f35c98a7b3527d84642554e..06c4776584152a476c734dcbf4ef6dc5535aa87f 100644 --- a/tests/library/Class/WebService/SIGB/VSmartTest.php +++ b/tests/library/Class/WebService/SIGB/VSmartTest.php @@ -20,7 +20,7 @@ */ include_once('VSmartFixtures.php'); -abstract class VSmartServiceTestCase extends Storm_Test_ModelTestCase { +abstract class VSmartServiceTestCase extends ModelTestCase { public function setUp() { $this->fixture('Class_CodifAnnexe', ['id'=> 1, @@ -35,7 +35,7 @@ abstract class VSmartServiceTestCase extends Storm_Test_ModelTestCase { } -class VSmartServiceDummyFunctionsTest extends Storm_Test_ModelTestCase { +class VSmartServiceDummyFunctionsTest extends ModelTestCase { public function setUp() { $this->service = Class_WebService_SIGB_VSmart_Service::newInstance(); } @@ -60,7 +60,7 @@ class VSmartServiceDummyFunctionsTest extends Storm_Test_ModelTestCase { -class VSmartGetServiceTest extends Storm_Test_ModelTestCase { +class VSmartGetServiceTest extends ModelTestCase { public function setUp() { Class_WebService_SIGB_VSmart::reset(); $this->service = Class_WebService_SIGB_VSmart::getService(['url_serveur' => 'vpn.moulins.fr']); @@ -419,7 +419,7 @@ class VSmartServiceWithEmprunteurFranckTest extends VSmartServiceTestCase { -class VSmartServiceBibGetAnthologieLitteratureTest extends Storm_Test_ModelTestCase { +class VSmartServiceBibGetAnthologieLitteratureTest extends ModelTestCase { public function setUp() { $mock_web_client = $this->mock() ->whenCalled('open_url') @@ -462,7 +462,7 @@ class VSmartServiceBibGetAnthologieLitteratureTest extends Storm_Test_ModelTestC -class VSmartServiceBibGetConsultationTest extends Storm_Test_ModelTestCase { +class VSmartServiceBibGetConsultationTest extends ModelTestCase { public function setUp() { $mock_web_client = $this->mock() ->whenCalled('open_url') @@ -498,7 +498,7 @@ class VSmartServiceBibGetConsultationTest extends Storm_Test_ModelTestCase { } -class VSmartServiceBibGetHarryPotterTest extends Storm_Test_ModelTestCase { +class VSmartServiceBibGetHarryPotterTest extends ModelTestCase { public function setUp() { $mock_web_client = $this->mock() ->whenCalled('open_url') @@ -659,7 +659,7 @@ class VSmartServiceBibGetHarryPotterTest extends Storm_Test_ModelTestCase { -class VSmartServiceFunctionsTest extends Storm_Test_ModelTestCase { +class VSmartServiceFunctionsTest extends ModelTestCase { public function setUp() { $this->mock_web_client = $this->mock(); $this->service = Class_WebService_SIGB_VSmart_Service::getService('86.64.58.38/formation/'); diff --git a/tests/library/Class/WebService/WebAnalyticsClientTest.php b/tests/library/Class/WebService/WebAnalyticsClientTest.php index ccfb737a6cdb312cf56c5d1aeb60322f54f8173f..b1cd673a1a787f301b7aa3df0b67ef9d4cf52712 100644 --- a/tests/library/Class/WebService/WebAnalyticsClientTest.php +++ b/tests/library/Class/WebService/WebAnalyticsClientTest.php @@ -20,7 +20,7 @@ */ -class Class_WebService_WebAnalyticsClientInstanciationWithVarGoogleAnalyticsAndNoDomainNameTest extends Storm_Test_ModelTestCase { +class Class_WebService_WebAnalyticsClientInstanciationWithVarGoogleAnalyticsAndNoDomainNameTest extends ModelTestCase { public function setUp() { parent::setUp(); @@ -59,7 +59,7 @@ class Class_WebService_WebAnalyticsClientInstanciationWithVarGoogleAnalyticsAndN -class Class_WebService_WebAnalyticsClientInstanciationWithVarGoogleAnalyticsUsingGACreateTest extends Storm_Test_ModelTestCase { +class Class_WebService_WebAnalyticsClientInstanciationWithVarGoogleAnalyticsUsingGACreateTest extends ModelTestCase { public function setUp() { parent::setUp(); @@ -80,7 +80,7 @@ class Class_WebService_WebAnalyticsClientInstanciationWithVarGoogleAnalyticsUsin -class Class_WebService_WebAnalyticsClientInstanciationWithVarGoogleAnalyticsAndDomainNameTest extends Storm_Test_ModelTestCase { +class Class_WebService_WebAnalyticsClientInstanciationWithVarGoogleAnalyticsAndDomainNameTest extends ModelTestCase { public function setUp() { parent::setUp(); @@ -118,7 +118,7 @@ class Class_WebService_WebAnalyticsClientInstanciationWithVarGoogleAnalyticsAndD -class Class_WebService_WebAnalyticsClientInstanciationWithWrongGoogleAnalyticsAndDomainNameTest extends Storm_Test_ModelTestCase { +class Class_WebService_WebAnalyticsClientInstanciationWithWrongGoogleAnalyticsAndDomainNameTest extends ModelTestCase { public function setUp() { parent::setUp(); @@ -144,7 +144,7 @@ class Class_WebService_WebAnalyticsClientInstanciationWithWrongGoogleAnalyticsAn -class Class_WebService_WebAnalyticsClientInstanciationWithVarPiwikAndNoDomainNameTest extends Storm_Test_ModelTestCase { +class Class_WebService_WebAnalyticsClientInstanciationWithVarPiwikAndNoDomainNameTest extends ModelTestCase { public function setUp() { parent::setUp(); diff --git a/tests/library/Class/WebkioskLinkTest.php b/tests/library/Class/WebkioskLinkTest.php index 810a8e19e512674178e47f8f3dc050d69c51775f..29e4af9e8ae6ae055579b9e1916cb7abfddac1dd 100644 --- a/tests/library/Class/WebkioskLinkTest.php +++ b/tests/library/Class/WebkioskLinkTest.php @@ -16,10 +16,10 @@ * * 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 */ -abstract class WebkioskLinkTestCase extends Storm_Test_ModelTestCase { +abstract class WebkioskLinkTestCase extends ModelTestCase { protected $_cle_pulique, @@ -50,7 +50,7 @@ dVvoKCi6/ItLM3QlJQJAEyvWEfvqKnFH13ID5oe/GVOih7O6VzgecEgd3ZawBVWd dsZ77MnSRzIyzrfJ3LlluaXhJl2qJBITE7X8y5RTKw== -----END RSA PRIVATE KEY-----"; - Class_AdminVar::newInstanceWithId('WEBKIOSK_KEY', + Class_AdminVar::newInstanceWithId('WEBKIOSK_KEY', ['valeur' => $this->_cle_publique]); Class_AdminVar::newInstanceWithId('WEBKIOSK_RESERVATION_URL', @@ -59,20 +59,20 @@ dsZ77MnSRzIyzrfJ3LlluaXhJl2qJBITE7X8y5RTKw== } class OpensslTestingAuth extends Class_Multimedia_Utils_OpensslUtil{ - public function opensslSeal($data, &$sealed_data, &$env_keys, + public function opensslSeal($data, &$sealed_data, &$env_keys, $pub_key_ids){ $sealed_data = json_encode(['login' => 'amadou', 'password' => 'secret', 'date' => date('Ymd')]); $env_keys[]= '123456789'; - + return true; } } class WebkioskLinkWithAbonneTest extends WebkioskLinkTestCase { - protected + protected $_webkiosk_link, $_amadou, $_auth_decrypte, @@ -89,8 +89,8 @@ class WebkioskLinkWithAbonneTest extends WebkioskLinkTestCase { $parts = parse_url($this->_url); parse_str($parts['query'], $elements); $sso = $elements['sso']; - $sso_json_decode =json_decode(base64_decode($sso)); - $this->_auth_decrypte = base64_decode($sso_json_decode->data_encrypted); + $sso_json_decode =json_decode(base64_decode($sso)); + $this->_auth_decrypte = base64_decode($sso_json_decode->data_encrypted); } diff --git a/tests/library/ZendAfi/Auth/TryHarderTest.php b/tests/library/ZendAfi/Auth/TryHarderTest.php index b4dd1decb742fb044d1fd27ee3431dc380f80839..9d0060905fdb0461ac3d4e63615c2b0823bb4235 100644 --- a/tests/library/ZendAfi/Auth/TryHarderTest.php +++ b/tests/library/ZendAfi/Auth/TryHarderTest.php @@ -29,6 +29,7 @@ class ZendAfi_Auth_TryHarderTest extends ModelTestCase { public function setUp() { parent::setUp(); + Class_Crypt::setPhpCommand(null); $this->fixture('Class_Users', ['id' => 1, diff --git a/tests/library/ZendAfi/AuthTest.php b/tests/library/ZendAfi/AuthTest.php index df18919dd280f09f849d4b78b80c1990f9d34f24..0f288b0867995b7e7a1fad253df3907acdede3fc 100644 --- a/tests/library/ZendAfi/AuthTest.php +++ b/tests/library/ZendAfi/AuthTest.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class AuthSessionNamespaceTest extends Storm_Test_ModelTestCase { +class AuthSessionNamespaceTest extends ModelTestCase { public function setUp() { parent::setup(); diff --git a/tests/library/ZendAfi/Form/LoginTest.php b/tests/library/ZendAfi/Form/LoginTest.php index 112f72305f55479fad2e1c9cc8d0b35d92e2d213..a85fad348196178014c6a80693d282bb48b2ca61 100644 --- a/tests/library/ZendAfi/Form/LoginTest.php +++ b/tests/library/ZendAfi/Form/LoginTest.php @@ -20,7 +20,7 @@ */ -abstract class ZendAfi_Form_LoginTestCase extends Storm_Test_ModelTestCase { +abstract class ZendAfi_Form_LoginTestCase extends ModelTestCase { protected $_form; public function setUp() {