@@ -82,15 +82,11 @@ protected function getCachingProxyPort()
82
82
}
83
83
84
84
/**
85
- * Get NGINX cache path
85
+ * Get Nginx cache directory
86
86
*/
87
87
protected function getCacheDir ()
88
88
{
89
- if (!defined ('NGINX_CACHE_PATH ' )) {
90
- throw new \Exception ('Specify the NGINX_CACHE_PATH in phpunit.xml or override getCacheDir() ' );
91
- }
92
-
93
- return NGINX_CACHE_PATH ;
89
+ return defined ('NGINX_CACHE_PATH ' ) ? NGINX_CACHE_PATH : null ;
94
90
}
95
91
96
92
/**
@@ -100,6 +96,7 @@ protected function getProxy()
100
96
{
101
97
if (null === $ this ->proxy ) {
102
98
$ this ->proxy = new NginxProxy ($ this ->getConfigFile ());
99
+ $ this ->proxy ->setPort ($ this ->getCachingProxyPort ());
103
100
104
101
if ($ this ->getBinary ()) {
105
102
$ this ->proxy ->setBinary ($ this ->getBinary ());
@@ -108,10 +105,6 @@ protected function getProxy()
108
105
if ($ this ->getCacheDir ()) {
109
106
$ this ->proxy ->setCacheDir ($ this ->getCacheDir ());
110
107
}
111
-
112
- if ($ this ->getCachingProxyPort ()) {
113
- $ this ->proxy ->setPort ($ this ->getCachingProxyPort ());
114
- }
115
108
}
116
109
117
110
return $ this ->proxy ;
@@ -120,11 +113,11 @@ protected function getProxy()
120
113
/**
121
114
* Get proxy client
122
115
*
123
- * @param bool| string $purgeLocation Optional purgeLocation
116
+ * @param string $purgeLocation Optional purgeLocation
124
117
*
125
- * @return \FOS\HttpCache\ProxyClient\ Nginx
118
+ * @return Nginx
126
119
*/
127
- protected function getProxyClient ($ purgeLocation = false )
120
+ protected function getProxyClient ($ purgeLocation = '' )
128
121
{
129
122
if (null === $ this ->proxyClient ) {
130
123
$ this ->proxyClient = new Nginx (
0 commit comments