Lines 18-24
Link Here
|
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
use Test::More tests => 3; |
21 |
use Test::More tests => 7; |
22 |
use Koha::BiblioFramework; |
22 |
use Koha::BiblioFramework; |
23 |
use Koha::BiblioFrameworks; |
23 |
use Koha::BiblioFrameworks; |
24 |
|
24 |
|
Lines 40-45
is( Koha::BiblioFrameworks->search->count, $nb_of_frameworks + 2, 'The 2 biblio
Link Here
|
40 |
my $retrieved_framework_1 = Koha::BiblioFrameworks->find( $new_framework_1->frameworkcode ); |
40 |
my $retrieved_framework_1 = Koha::BiblioFrameworks->find( $new_framework_1->frameworkcode ); |
41 |
is( $retrieved_framework_1->frameworktext, $new_framework_1->frameworktext, 'Find a biblio framework by frameworkcode should return the correct framework' ); |
41 |
is( $retrieved_framework_1->frameworktext, $new_framework_1->frameworktext, 'Find a biblio framework by frameworkcode should return the correct framework' ); |
42 |
|
42 |
|
|
|
43 |
# testing of default frameworks |
44 |
$new_framework_1->set_default; |
45 |
my $default_framework = Koha::BiblioFrameworks->get_default; |
46 |
is( $default_framework->frameworkcode, $new_framework_1->frameworkcode, 'Successfully identified default framework' ); |
47 |
|
48 |
$new_framework_2->set_default; |
49 |
$default_framework = Koha::BiblioFrameworks->get_default; |
50 |
is( $default_framework->frameworkcode, $new_framework_2->frameworkcode, 'Successfully changed default framework' ); |
51 |
$new_framework_1 = Koha::BiblioFrameworks->find( $new_framework_1->frameworkcode ); |
52 |
is( $new_framework_1->is_default, 0, 'Old default framework has been unset' ); |
53 |
|
54 |
$default_framework->unset_default; |
55 |
my $nb_of_defaults = Koha::BiblioFrameworks->search({ is_default => 1 })->count; |
56 |
is( $nb_of_defaults, 0, 'No default framework is set' ); |
57 |
# end of default frameworks testing |
58 |
|
43 |
$retrieved_framework_1->delete; |
59 |
$retrieved_framework_1->delete; |
44 |
is( Koha::BiblioFrameworks->search->count, $nb_of_frameworks + 1, 'Delete should have deleted the biblio framework' ); |
60 |
is( Koha::BiblioFrameworks->search->count, $nb_of_frameworks + 1, 'Delete should have deleted the biblio framework' ); |
45 |
$schema->storage->txn_rollback; |
61 |
$schema->storage->txn_rollback; |
46 |
- |
|
|