Skip to content

Commit 1a711b9

Browse files
committed
Merge pull request #216 from FriendsOfSymfony/varnish-4-default
Change default Varnish version to 4
2 parents c023e9c + 02f89bd commit 1a711b9

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ See also the [GitHub releases page](https://github.com/FriendsOfSymfony/FOSHttpC
1111
calling `setPurgeLocation()`.
1212
* In ProxyTestCase, `getHttpClient()` has been replaced with `getHttpAdapter()`;
1313
added HTTP method parameter to `getResponse()`.
14+
* Changed default Varnish version to 4.
1415

1516
1.4.0
1617
-----

doc/testing-your-application.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Constant Getter Default
8080
``VARNISH_PORT`` ``getCachingProxyPort()`` ``6181`` port Varnish listens on
8181
``VARNISH_MGMT_PORT`` ``getVarnishMgmtPort()`` ``6182`` Varnish management port
8282
``VARNISH_CACHE_DIR`` ``getCacheDir()`` ``sys_get_temp_dir()`` + ``/foshttpcache-varnish`` directory to use for cache
83-
``VARNISH_VERSION`` ``getVarnishVersion()`` ``3`` installed varnish application version
83+
``VARNISH_VERSION`` ``getVarnishVersion()`` ``4`` installed varnish application version
8484
``WEB_SERVER_HOSTNAME`` ``getHostName()`` hostname your application can be reached at
8585
======================= ========================= ================================================== ===========================================
8686

src/Test/VarnishTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* VARNISH_MGMT_PORT Varnish management port (default 6182)
3636
* VARNISH_CACHE_DIR directory to use for cache
3737
* (default sys_get_temp_dir() + '/foshttpcache-varnish')
38-
* VARNISH_VERSION Version of varnish: 3 or 4, defaults to 3.
38+
* VARNISH_VERSION Version of varnish: 3 or 4, defaults to 4.
3939
* WEB_SERVER_HOSTNAME hostname/IP your application can be reached at (required)
4040
*/
4141
abstract class VarnishTestCase extends ProxyTestCase
@@ -107,13 +107,13 @@ protected function getCacheDir()
107107
}
108108

109109
/**
110-
* Defaults to 3
110+
* Defaults to 4
111111
*
112112
* @return int
113113
*/
114114
protected function getVarnishVersion()
115115
{
116-
return getenv('VARNISH_VERSION') ?: 3;
116+
return getenv('VARNISH_VERSION') ?: 4;
117117
}
118118

119119
/**

tests/Functional/Varnish/UserContextFailureTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ public function testHashRequestFailure()
9090
protected function getConfigFile()
9191
{
9292
switch ($this->getVarnishVersion()) {
93-
case '4.0':
94-
return sprintf('./tests/Functional/Fixtures/varnish-4/user_context_%s.vcl', $this->mode);
95-
default:
93+
case 3:
9694
return sprintf('./tests/Functional/Fixtures/varnish-3/user_context_%s.vcl', $this->mode);
95+
default:
96+
return sprintf('./tests/Functional/Fixtures/varnish-4/user_context_%s.vcl', $this->mode);
9797
}
9898
}
9999
}

tests/bootstrap.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
if (!defined('VARNISH_FILE')) {
1818
if (getenv('VARNISH_VERSION')
19-
&& (0 === strncmp('4.', getenv('VARNISH_VERSION'), 2))
19+
&& (0 === strncmp('3.', getenv('VARNISH_VERSION'), 2))
2020
) {
21-
define('VARNISH_FILE', './tests/Functional/Fixtures/varnish-4/fos.vcl');
22-
} else {
2321
define('VARNISH_FILE', './tests/Functional/Fixtures/varnish-3/fos.vcl');
22+
} else {
23+
define('VARNISH_FILE', './tests/Functional/Fixtures/varnish-4/fos.vcl');
2424
}
2525
}
2626

0 commit comments

Comments
 (0)