diff options
author | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-09-23 21:47:47 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-10-07 20:58:22 +0200 |
commit | 67d3574bdfdc08ad5815b5034a7c2c2e35afb4c0 (patch) | |
tree | 422684c7cb62f1f0e6b709e9160d0073cbadc5ea /tests | |
parent | bccc4e618a58281f390b6baa88cc0b03b1e40172 (diff) | |
download | nextcloud-server-67d3574bdfdc08ad5815b5034a7c2c2e35afb4c0.tar.gz nextcloud-server-67d3574bdfdc08ad5815b5034a7c2c2e35afb4c0.zip |
Don't parse info.xml but reuse already cached app infos - fixes #25603 (#25968)
* Don't parse info.xml but reuse already cached app infos - fixes #25603
* Use === in InfoParser. Fixes test
* InfoParser should not depend on UrlGenerator - fixes issue with session being closed too early
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/app/expected-info.json | 4 | ||||
-rw-r--r-- | tests/lib/App/CodeChecker/InfoCheckerTest.php | 4 | ||||
-rw-r--r-- | tests/lib/App/InfoParserTest.php | 17 |
3 files changed, 6 insertions, 19 deletions
diff --git a/tests/data/app/expected-info.json b/tests/data/app/expected-info.json index 6d8d85ab552..6ddd3ae8568 100644 --- a/tests/data/app/expected-info.json +++ b/tests/data/app/expected-info.json @@ -10,8 +10,8 @@ "requiremin": "4", "shipped": "true", "documentation": { - "user": "https://docs.example.com/server/go.php?to=user-encryption", - "admin": "https://docs.example.com/server/go.php?to=admin-encryption" + "user": "user-encryption", + "admin": "admin-encryption" }, "rememberlogin": "false", "types": ["filesystem"], diff --git a/tests/lib/App/CodeChecker/InfoCheckerTest.php b/tests/lib/App/CodeChecker/InfoCheckerTest.php index 1032e800be1..c16874fbd33 100644 --- a/tests/lib/App/CodeChecker/InfoCheckerTest.php +++ b/tests/lib/App/CodeChecker/InfoCheckerTest.php @@ -44,9 +44,7 @@ class InfoCheckerTest extends TestCase { protected function setUp() { parent::setUp(); - $infoParser = new InfoParser(\OC::$server->getURLGenerator()); - - $this->infoChecker = new InfoChecker($infoParser); + $this->infoChecker = new InfoChecker(new InfoParser()); } public function appInfoData() { diff --git a/tests/lib/App/InfoParserTest.php b/tests/lib/App/InfoParserTest.php index 7f52507bcf7..af2dfd2ef1c 100644 --- a/tests/lib/App/InfoParserTest.php +++ b/tests/lib/App/InfoParserTest.php @@ -10,27 +10,16 @@ namespace Test\App; use OC; -use OCP\IURLGenerator; +use OC\App\InfoParser; use Test\TestCase; class InfoParserTest extends TestCase { - /** @var \OC\App\InfoParser */ + /** @var InfoParser */ private $parser; public function setUp() { - $urlGenerator = $this->getMockBuilder('\OCP\IURLGenerator') - ->disableOriginalConstructor() - ->getMock(); - - /** @var IURLGenerator | \PHPUnit_Framework_MockObject_MockObject $urlGenerator */ - $urlGenerator->expects($this->any()) - ->method('linkToDocs') - ->will($this->returnCallback(function ($url) { - return "https://docs.example.com/server/go.php?to=$url"; - })); - - $this->parser = new \OC\App\InfoParser($urlGenerator); + $this->parser = new InfoParser(); } /** |