From 912aa4f82b0da2a05168091e78225b03b800ed1f Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Thu, 11 Aug 2016 19:33:33 +0200 Subject: [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 --- apps/federatedfilesharing/lib/DiscoveryManager.php | 6 ++++++ apps/federatedfilesharing/tests/DiscoveryManagerTest.php | 1 + 2 files changed, 7 insertions(+) (limited to 'apps') 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() { -- cgit v1.2.3