|
Lines 132-146
subtest 'needs_install use case tests' => sub {
Link Here
|
| 132 |
my $plugins = Koha::Plugins->new; |
132 |
my $plugins = Koha::Plugins->new; |
| 133 |
$plugins->InstallPlugins; |
133 |
$plugins->InstallPlugins; |
| 134 |
|
134 |
|
| 135 |
my @plugins = $plugins->GetPlugins( { all => 1 } ); |
|
|
| 136 |
foreach my $plugin (@plugins) { |
| 137 |
$good_plugin = $plugin |
| 138 |
if $plugin->{metadata}->{description} eq 'Test plugin'; |
| 139 |
} |
| 140 |
|
| 141 |
# mock Version before initializing the API class |
135 |
# mock Version before initializing the API class |
| 142 |
t::lib::Mocks::mock_preference('Version', undef); |
136 |
t::lib::Mocks::mock_preference('Version', undef); |
| 143 |
# initialize Koha::REST::V1 after mocking |
137 |
# initialize Koha::REST::V1 after mocking |
|
|
138 |
|
| 144 |
my $t = Test::Mojo->new('Koha::REST::V1'); |
139 |
my $t = Test::Mojo->new('Koha::REST::V1'); |
| 145 |
my $routes = get_defined_routes($t); |
140 |
my $routes = get_defined_routes($t); |
| 146 |
|
141 |
|
|
Lines 153-158
subtest 'needs_install use case tests' => sub {
Link Here
|
| 153 |
); |
148 |
); |
| 154 |
|
149 |
|
| 155 |
t::lib::Mocks::mock_preference('Version', '3.0.0'); |
150 |
t::lib::Mocks::mock_preference('Version', '3.0.0'); |
|
|
151 |
|
| 152 |
$schema->resultset('PluginData')->delete; |
| 153 |
$plugins->InstallPlugins; |
| 154 |
|
| 156 |
# re-initialize Koha::REST::V1 after mocking |
155 |
# re-initialize Koha::REST::V1 after mocking |
| 157 |
$t = Test::Mojo->new('Koha::REST::V1'); |
156 |
$t = Test::Mojo->new('Koha::REST::V1'); |
| 158 |
$routes = get_defined_routes($t); |
157 |
$routes = get_defined_routes($t); |
| 159 |
- |
|
|