Bugzilla – Attachment 58055 Details for
Bug 17493
Improve OAI Server tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17493: [QA Follow-up] Foreach loop and module
Bug-17493-QA-Follow-up-Foreach-loop-and-module.patch (text/plain), 2.80 KB, created by
Marcel de Rooy
on 2016-12-09 09:40:38 UTC
(
hide
)
Description:
Bug 17493: [QA Follow-up] Foreach loop and module
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-12-09 09:40:38 UTC
Size:
2.80 KB
patch
obsolete
>From b709d9f9e70f012fb84f233639852165984d1d3a Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 9 Dec 2016 09:46:33 +0100 >Subject: [PATCH] Bug 17493: [QA Follow-up] Foreach loop and module >Content-Type: text/plain; charset=utf-8 > >Few cosmetic changes. >Removed TestBuilder. Rearranged modules (added one). Whitespace changes. >For loop instead of a map statement. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/OAI/Server.t | 30 ++++++++++++------------------ > 1 file changed, 12 insertions(+), 18 deletions(-) > >diff --git a/t/db_dependent/OAI/Server.t b/t/db_dependent/OAI/Server.t >index 1a23291..bc35903 100644 >--- a/t/db_dependent/OAI/Server.t >+++ b/t/db_dependent/OAI/Server.t >@@ -17,19 +17,20 @@ > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >- > use Modern::Perl; >-use C4::Context; >-use C4::Biblio; >+ > use Test::More tests => 27; >+use DateTime; > use Test::MockModule; > use Test::Warn; >-use DateTime; > use XML::Simple; >-use t::lib::Mocks; >-use t::lib::TestBuilder; > use YAML; > >+use t::lib::Mocks; >+ >+use C4::Biblio; >+use C4::Context; >+use Koha::Database; > > BEGIN { > use_ok('Koha::OAI::Server::DeletedRecord'); >@@ -45,30 +46,27 @@ BEGIN { > use_ok('Koha::OAI::Server::ResumptionToken'); > } > >- > # Mocked CGI module in order to be able to send CGI parameters to OAI Server > my %param; > my $module = Test::MockModule->new('CGI'); >- $module->mock('Vars', sub { %param; }); >+$module->mock('Vars', sub { %param; }); > > my $schema = Koha::Database->schema; > $schema->storage->txn_begin; > my $dbh = C4::Context->dbh; > >-my $builder = t::lib::TestBuilder->new; >- > $dbh->do('SET FOREIGN_KEY_CHECKS = 0'); > $dbh->do('TRUNCATE biblio'); > $dbh->do('TRUNCATE biblioitems'); > $dbh->do('TRUNCATE issues'); > >-# Add 10 biblio records > our $tz = DateTime::TimeZone->new( name => 'local' ); > my $date_added = DateTime->now(time_zone =>$tz) . 'Z'; > my $date_to = substr($date_added, 0, 10) . 'T23:59:59Z'; >- > my (@header, @marcxml, @oaidc); >-map { >+ >+# Add 10 biblio records >+foreach( 1..10 ) { > my $record = MARC::Record->new(); > $record->append_fields( MARC::Field->new('245', '', '', 'a' => "Title $_" ) ); > my ($biblionumber) = AddBiblio($record, ''); >@@ -109,9 +107,7 @@ map { > }, > }, > }; >- $biblionumber => undef; >-} (1..10); >- >+} > > my $syspref = { > 'LibraryName' => 'My Library', >@@ -125,7 +121,6 @@ while ( my ($name, $value) = each %$syspref ) { > t::lib::Mocks::mock_preference( $name => $value ); > } > >- > sub test_query { > my ($test, $param, $expected) = @_; > >@@ -158,7 +153,6 @@ sub test_query { > } > } > >- > test_query('ListMetadataFormats', {verb => 'ListMetadataFormats'}, { > ListMetadataFormats => { > metadataFormat => [ >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17493
:
56796
|
56797
|
56827
|
56843
|
57126
|
58054
| 58055