--- /dev/null
+package Koha::Tag;
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use Modern::Perl;
+
+use Carp;
+
+use base qw(Koha::Object);
+
+=head1 NAME
+
+Koha::Tag - Koha Tag Object class
+
+=head1 API
+
+=head2 Internal methods
+
+=cut
+
+=head3 _type
+
+=cut
+
+sub _type {
+ return 'TagAll';
+}
+
+1;
--- /dev/null
+package Koha::Tags;
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use Modern::Perl;
+
+use Carp;
+
+use Koha::Tag;
+
+use base qw(Koha::Objects);
+
+=head1 NAME
+
+Koha::Tags - Koha Tags Object set class
+
+=head1 API
+
+=head2 Internal methods
+
+=cut
+
+=head3 _type
+
+=cut
+
+sub _type {
+ return 'TagAll';
+}
+
+=head3 object_class
+
+=cut
+
+sub object_class {
+ return 'Koha::Tag';
+}
+
+1;
--- /dev/null
+package Koha::Tags::Approval;
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use Modern::Perl;
+
+use Carp;
+
+use base qw(Koha::Object);
+
+=head1 NAME
+
+Koha::Tags::Approval - Koha Tag approval Object class
+
+=head1 API
+
+=head2 Internal methods
+
+=cut
+
+=head3 _type
+
+=cut
+
+sub _type {
+ return 'TagsApproval';
+}
+
+1;
--- /dev/null
+package Koha::Tags::Approvals;
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use Modern::Perl;
+
+use Carp;
+
+use Koha::Tags::Approval;
+
+use base qw(Koha::Objects);
+
+=head1 NAME
+
+Koha::Tags::Approvals - Koha Tag Approvals Object set class
+
+=head1 API
+
+=head2 Internal methods
+
+=cut
+
+=head3 _type
+
+=cut
+
+sub _type {
+ return 'TagsApproval';
+}
+
+=head3 object_class
+
+=cut
+
+sub object_class {
+ return 'Koha::Tags::Approval';
+}
+
+1;
--- /dev/null
+package Koha::Tags::Index;
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use Modern::Perl;
+
+use Carp;
+
+use base qw(Koha::Object);
+
+=head1 NAME
+
+Koha::Tags::Index - Koha Tag approval Object class
+
+=head1 API
+
+=head2 Internal methods
+
+=cut
+
+=head3 _type
+
+=cut
+
+sub _type {
+ return 'TagsIndex';
+}
+
+1;
--- /dev/null
+package Koha::Tags::Indexes;
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use Modern::Perl;
+
+use Carp;
+
+use Koha::Tags::Index;
+
+use base qw(Koha::Objects);
+
+=head1 NAME
+
+Koha::Tags::Indexes - Koha Tag Indexes Object set class
+
+=head1 API
+
+=head2 Internal methods
+
+=cut
+
+=head3 _type
+
+=cut
+
+sub _type {
+ return 'TagsIndex';
+}
+
+=head3 object_class
+
+=cut
+
+sub object_class {
+ return 'Koha::Tags::Index';
+}
+
+1;
--- /dev/null
+#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# 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 Test::More tests => 1;
+
+use t::lib::TestBuilder;
+
+use Koha::Database;
+use Koha::Tags;
+
+my $schema = Koha::Database->schema;
+my $builder = t::lib::TestBuilder->new;
+
+subtest 'search() tests' => sub {
+
+ plan tests => 1;
+
+ $schema->storage->txn_begin;
+
+ my $current_count = Koha::Tags->search->count;
+
+ my $approval_1 = $builder->build_object({ class => 'Koha::Tags' });
+ my $approval_2 = $builder->build_object({ class => 'Koha::Tags' });
+
+ is( Koha::Tags->search->count, $current_count + 2, 'Tags count consistent' );
+
+ $schema->storage->txn_rollback;
+
+};
--- /dev/null
+#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# 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 Test::More tests => 1;
+
+use t::lib::TestBuilder;
+
+use Koha::Database;
+use Koha::Tags::Approvals;
+
+my $schema = Koha::Database->schema;
+my $builder = t::lib::TestBuilder->new;
+
+subtest 'search() tests' => sub {
+
+ plan tests => 1;
+
+ $schema->storage->txn_begin;
+
+ my $current_count = Koha::Tags::Approvals->search->count;
+
+ my $approval_1 = $builder->build_object({ class => 'Koha::Tags::Approvals' });
+ my $approval_2 = $builder->build_object({ class => 'Koha::Tags::Approvals' });
+
+ is( Koha::Tags::Approvals->search->count, $current_count + 2, 'Approvals count consistent' );
+
+ $schema->storage->txn_rollback;
+
+};
--- /dev/null
+#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# 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 Test::More tests => 1;
+
+use t::lib::TestBuilder;
+
+use Koha::Database;
+use Koha::Tags::Indexes;
+
+my $schema = Koha::Database->schema;
+my $builder = t::lib::TestBuilder->new;
+
+subtest 'search() tests' => sub {
+
+ plan tests => 1;
+
+ $schema->storage->txn_begin;
+
+ my $current_count = Koha::Tags::Indexes->search->count;
+
+ my $approval_1 = $builder->build_object({ class => 'Koha::Tags::Indexes' });
+ my $approval_2 = $builder->build_object({ class => 'Koha::Tags::Indexes' });
+
+ is( Koha::Tags::Indexes->search->count, $current_count + 2, 'Indexes count consistent' );
+
+ $schema->storage->txn_rollback;
+
+};