@@ -82,15 +82,11 @@ protected function getCachingProxyPort()
8282 }
8383
8484 /**
85- * Get NGINX cache path
85+ * Get Nginx cache directory
8686 */
8787 protected function getCacheDir ()
8888 {
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 ;
9490 }
9591
9692 /**
@@ -100,6 +96,7 @@ protected function getProxy()
10096 {
10197 if (null === $ this ->proxy ) {
10298 $ this ->proxy = new NginxProxy ($ this ->getConfigFile ());
99+ $ this ->proxy ->setPort ($ this ->getCachingProxyPort ());
103100
104101 if ($ this ->getBinary ()) {
105102 $ this ->proxy ->setBinary ($ this ->getBinary ());
@@ -108,10 +105,6 @@ protected function getProxy()
108105 if ($ this ->getCacheDir ()) {
109106 $ this ->proxy ->setCacheDir ($ this ->getCacheDir ());
110107 }
111-
112- if ($ this ->getCachingProxyPort ()) {
113- $ this ->proxy ->setPort ($ this ->getCachingProxyPort ());
114- }
115108 }
116109
117110 return $ this ->proxy ;
@@ -120,11 +113,11 @@ protected function getProxy()
120113 /**
121114 * Get proxy client
122115 *
123- * @param bool| string $purgeLocation Optional purgeLocation
116+ * @param string $purgeLocation Optional purgeLocation
124117 *
125- * @return \FOS\HttpCache\ProxyClient\ Nginx
118+ * @return Nginx
126119 */
127- protected function getProxyClient ($ purgeLocation = false )
120+ protected function getProxyClient ($ purgeLocation = '' )
128121 {
129122 if (null === $ this ->proxyClient ) {
130123 $ this ->proxyClient = new Nginx (
0 commit comments