Skip to content

Commit

Permalink
Fix discoverymanager tests (#25769)
Browse files Browse the repository at this point in the history
* Allow testing of the DiscoveryManager

* Array sort order is of no relevance
  • Loading branch information
DeepDiver1975 authored Aug 11, 2016
1 parent 8f14dc2 commit d2e2021
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion apps/federatedfilesharing/lib/DiscoveryManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class DiscoveryManager {
private $cache;
/** @var IClient */
private $client;
/** @var bool */
public $underTest = false;

/**
* @param ICacheFactory $cacheFactory
Expand Down Expand Up @@ -84,7 +86,7 @@ private function discover($remote) {
'share' => '/ocs/v1.php/cloud/shares',
];

if (defined('PHPUNIT_RUN')) {
if (defined('PHPUNIT_RUN') && !$this->underTest) {
return $discoveredServices;
}
// Read the data from the response body
Expand Down
1 change: 1 addition & 0 deletions apps/federatedfilesharing/tests/DiscoveryManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public function setUp() {
$cacheFactory,
$clientService
);
$this->discoveryManager->underTest = true;
}

public function testWithMalformedFormattedEndpointCached() {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/SystemTag/SystemTagObjectMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function testGetObjectsForTags() {
$this->assertEquals([
'1',
'2',
], $objectIds);
], $objectIds, '', 0.0, 10, true);
}

public function testGetObjectsForTagsLimit() {
Expand Down

0 comments on commit d2e2021

Please sign in to comment.