[Koha-bugs] [Bug 10298] t::lib::Mocks tries to deal with syspref but doesn not manage to

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jun 14 15:25:33 CEST 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10298

Julian Maurice <julian.maurice at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |julian.maurice at biblibre.com

--- Comment #5 from Julian Maurice <julian.maurice at biblibre.com> ---
$ prove -r t/searchengine                        
t/searchengine/000_conn/conn.t ........... ok   
t/searchengine/001_search/search_base.t .. ok   
t/searchengine/002_index/index_base.t .... IndexRecord called with biblio 2 at
/home/koha/src/Koha/SearchEngine/Solr/Index.pm line 35.
t/searchengine/002_index/index_base.t .... ok   
t/searchengine/003_query/buildquery.t .... ok   
t/searchengine/004_config/load_config.t .. ok    
All tests successful.

$ prove t/db_dependent/Circulation_issuingrules.t
t/db_dependent/Circulation_issuingrules.t .. ok          
All tests successful.

$ perl <<EOF                                     
use Modern::Perl;
use t::lib::Mocks;
use C4::Context;

say "initial value for version: " . C4::Context->preference('Version');
say "initial value for language: " . C4::Context->preference('language');
t::lib::Mocks::mock_preference('Version', "new version for testing");
say "version is mocked with: " . C4::Context->preference('Version');
say "language is not yet mocked: " . C4::Context->preference('language');
t::lib::Mocks::mock_preference('language', 'new langage for testing');
t::lib::Mocks::mock_preference('Version', 'another version for testing');
say "version is mocked with another value: " .
C4::Context->preference('Version');
say "language is finally mocked: " . C4::Context->preference('language');
EOF
initial value for version: 3.1300007
initial value for language: en,fr-FR
version is mocked with: new version for testing
language is not yet mocked: en,fr-FR
version is mocked with another value: another version for testing
language is finally mocked: new langage for testing

I know these are BibLibre patches but mock_config and mock_preference will be
more and more needed in the future to write unit tests and this does not affect
Koha behaviour, so I think a QA review will be good enough for those patches to
pass.
Signed off.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list