diff options
author | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-08-11 19:33:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-11 19:33:33 +0200 |
commit | 912aa4f82b0da2a05168091e78225b03b800ed1f (patch) | |
tree | b270b8bb29235815cfe90e6c22e7d8b1592669ea /apps | |
parent | 4b1b5adb34e327009676755789029aaeb63906bd (diff) | |
download | nextcloud-server-912aa4f82b0da2a05168091e78225b03b800ed1f.tar.gz nextcloud-server-912aa4f82b0da2a05168091e78225b03b800ed1f.zip |
[Stable9.1] fix unit test on new jenkins setup and adjust Jenkinsfile (#25772)
* [stable9.1] Next step jenkinsfile (#25622)
* Adding timestamper and evaluation of test results even in case of failure
* Adding build timeout
* use fixed value 120 minutes as timeout for each test executing for now
* Terminate the build as soon as test execution fails
* Adjust external testing as well
* Finalize use of executeAndReport
* [stable9.1] Fix discoverymanager tests (#25769)
* Allow testing of the DiscoveryManager
* Array sort order is of no relevance
Diffstat (limited to 'apps')
-rw-r--r-- | apps/federatedfilesharing/lib/DiscoveryManager.php | 6 | ||||
-rw-r--r-- | apps/federatedfilesharing/tests/DiscoveryManagerTest.php | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/apps/federatedfilesharing/lib/DiscoveryManager.php b/apps/federatedfilesharing/lib/DiscoveryManager.php index 25af0a40fd5..13af9ba78aa 100644 --- a/apps/federatedfilesharing/lib/DiscoveryManager.php +++ b/apps/federatedfilesharing/lib/DiscoveryManager.php @@ -39,6 +39,8 @@ class DiscoveryManager { private $cache; /** @var IClient */ private $client; + /** @var bool */ + public $underTest = false; /** * @param ICacheFactory $cacheFactory @@ -82,6 +84,10 @@ class DiscoveryManager { 'share' => '/ocs/v1.php/cloud/shares', ]; + if (defined('PHPUNIT_RUN') && !$this->underTest) { + return $discoveredServices; + } + // Read the data from the response body try { $response = $this->client->get($remote . '/ocs-provider/', [ diff --git a/apps/federatedfilesharing/tests/DiscoveryManagerTest.php b/apps/federatedfilesharing/tests/DiscoveryManagerTest.php index a9c324f0244..28c129bc9ae 100644 --- a/apps/federatedfilesharing/tests/DiscoveryManagerTest.php +++ b/apps/federatedfilesharing/tests/DiscoveryManagerTest.php @@ -62,6 +62,7 @@ class DiscoveryManagerTest extends \Test\TestCase { $cacheFactory, $clientService ); + $this->discoveryManager->underTest = true; } public function testWithMalformedFormattedEndpointCached() { |