diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 48bd57f4c104c753ce3c7131c770b524d54ee1e5..eb1f8a456bf49852e26d983288db46438d2c2f07 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -396,10 +396,10 @@ class Installer { } if ($this->apps === null) { - $apps = $this->appFetcher->get(); + $this->apps = $this->appFetcher->get(); } - foreach($apps as $app) { + foreach($this->apps as $app) { if($app['id'] === $appId) { $currentVersion = OC_App::getAppVersion($appId); $newestVersion = $app['releases'][0]['version']; diff --git a/tests/lib/InstallerTest.php b/tests/lib/InstallerTest.php index 897bc472103040642b28f079dd92da4c34bb1c85..c7e4bfeacfbc6c3d5f110aef89213ef7c565262c 100644 --- a/tests/lib/InstallerTest.php +++ b/tests/lib/InstallerTest.php @@ -156,6 +156,7 @@ class InstallerTest extends TestCase { $installer = $this->getInstaller(); $this->assertSame($updateAvailable, $installer->isUpdateAvailable('files')); + $this->assertSame($updateAvailable, $installer->isUpdateAvailable('files'), 'Cached result should be returned and fetcher should be only called once'); } /**