summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-05-19 23:04:51 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-05-20 09:51:07 +0200
commit6ffde128ad17a1ebe38f8d18b21a37d01b47c46b (patch)
tree5fd3ef25fcbffa5d1011b2e6d38f5c5e56cfdd86 /tests
parent3e0d8df0364bfb9da5d36e714e3de1c56f02dcd4 (diff)
downloadnextcloud-server-6ffde128ad17a1ebe38f8d18b21a37d01b47c46b.tar.gz
nextcloud-server-6ffde128ad17a1ebe38f8d18b21a37d01b47c46b.zip
Compress the appstore requests by default
In test it reduced the transfered data from 5 MB to 2 MB. This should reduce the load on the appstore significantly. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/App/AppStore/Fetcher/FetcherBase.php47
1 files changed, 42 insertions, 5 deletions
diff --git a/tests/lib/App/AppStore/Fetcher/FetcherBase.php b/tests/lib/App/AppStore/Fetcher/FetcherBase.php
index 2e04f22760e..45f3f22b9d4 100644
--- a/tests/lib/App/AppStore/Fetcher/FetcherBase.php
+++ b/tests/lib/App/AppStore/Fetcher/FetcherBase.php
@@ -249,7 +249,15 @@ abstract class FetcherBase extends TestCase {
$client
->expects($this->once())
->method('get')
- ->with($this->endpoint)
+ ->with(
+ $this->equalTo($this->endpoint),
+ $this->equalTo([
+ 'timeout' => 10,
+ 'headers' => [
+ 'Accept-Encoding' => 'gzip',
+ ]
+ ])
+ )
->willReturn($response);
$response
->expects($this->once())
@@ -342,7 +350,15 @@ abstract class FetcherBase extends TestCase {
$client
->expects($this->once())
->method('get')
- ->with($this->endpoint)
+ ->with(
+ $this->equalTo($this->endpoint),
+ $this->equalTo([
+ 'timeout' => 10,
+ 'headers' => [
+ 'Accept-Encoding' => 'gzip',
+ ]
+ ])
+ )
->willReturn($response);
$response
->expects($this->once())
@@ -430,7 +446,15 @@ abstract class FetcherBase extends TestCase {
$client
->expects($this->once())
->method('get')
- ->with($this->endpoint)
+ ->with(
+ $this->equalTo($this->endpoint),
+ $this->equalTo([
+ 'timeout' => 10,
+ 'headers' => [
+ 'Accept-Encoding' => 'gzip',
+ ]
+ ])
+ )
->willReturn($response);
$response
->expects($this->once())
@@ -495,7 +519,15 @@ abstract class FetcherBase extends TestCase {
$client
->expects($this->once())
->method('get')
- ->with($this->endpoint)
+ ->with(
+ $this->equalTo($this->endpoint),
+ $this->equalTo([
+ 'timeout' => 10,
+ 'headers' => [
+ 'Accept-Encoding' => 'gzip',
+ ]
+ ])
+ )
->willThrowException(new \Exception());
$this->assertSame([], $this->fetcher->get());
@@ -552,7 +584,8 @@ abstract class FetcherBase extends TestCase {
$this->equalTo([
'timeout' => 10,
'headers' => [
- 'If-None-Match' => '"myETag"'
+ 'Accept-Encoding' => 'gzip',
+ 'If-None-Match' => '"myETag"',
]
])
)->willReturn($response);
@@ -624,6 +657,7 @@ abstract class FetcherBase extends TestCase {
$this->equalTo([
'timeout' => 10,
'headers' => [
+ 'Accept-Encoding' => 'gzip',
'If-None-Match' => '"myETag"',
]
])
@@ -710,6 +744,9 @@ abstract class FetcherBase extends TestCase {
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 10,
+ 'headers' => [
+ 'Accept-Encoding' => 'gzip',
+ ],
])
)
->willReturn($response);