Browse Source

Fix tests when run on windows

Mark Story 6 years ago
parent
commit
293da3d401

+ 3 - 3
tests/TestCase/Error/ErrorHandlerTest.php

@@ -271,14 +271,14 @@ class ErrorHandlerTest extends TestCase
             ->method('log')
             ->with('error', $this->logicalAnd(
                 $this->stringContains('[Cake\Http\Exception\NotFoundException] Kaboom!'),
-                $this->stringContains('vendor/phpunit/phpunit/src/Framework/TestCase.php')
+                $this->stringContains(str_replace('/', DS, 'vendor/phpunit/phpunit/src/Framework/TestCase.php'))
             ));
 
         $this->_logger->expects($this->at(1))
             ->method('log')
             ->with('error', $this->logicalAnd(
                 $this->stringContains('[Cake\Http\Exception\NotFoundException] Kaboom!'),
-                $this->logicalNot($this->stringContains('vendor/phpunit/phpunit/src/Framework/TestCase.php'))
+                $this->logicalNot($this->stringContains(str_replace('/', DS, 'vendor/phpunit/phpunit/src/Framework/TestCase.php')))
             ));
 
         $errorHandler->handleException($error);
@@ -352,7 +352,7 @@ class ErrorHandlerTest extends TestCase
             ->with('error', $this->logicalAnd(
                 $this->stringContains('[Cake\Http\Exception\NotFoundException] Kaboom!'),
                 $this->stringContains('Caused by: [Cake\Datasource\Exception\RecordNotFoundException] Previous logged'),
-                $this->stringContains('vendor/phpunit/phpunit/src/Framework/TestCase.php')
+                $this->stringContains(str_replace('/', DS, 'vendor/phpunit/phpunit/src/Framework/TestCase.php'))
             ));
 
         $errorHandler->handleException($error);

+ 2 - 2
tests/TestCase/Error/Middleware/ErrorHandlerMiddlewareTest.php

@@ -176,7 +176,7 @@ class ErrorHandlerMiddlewareTest extends TestCase
             ->method('log')
             ->with('error', $this->logicalAnd(
                 $this->stringContains('[Cake\Http\Exception\NotFoundException] Kaboom!'),
-                $this->stringContains('vendor/phpunit/phpunit/src/Framework/TestCase.php'),
+                $this->stringContains(str_replace('/', DS, 'vendor/phpunit/phpunit/src/Framework/TestCase.php')),
                 $this->stringContains('Request URL: /target/url'),
                 $this->stringContains('Referer URL: /other/path'),
                 $this->logicalNot(
@@ -209,7 +209,7 @@ class ErrorHandlerMiddlewareTest extends TestCase
             ->with('error', $this->logicalAnd(
                 $this->stringContains('[Cake\Http\Exception\NotFoundException] Kaboom!'),
                 $this->stringContains('Caused by: [Cake\Datasource\Exception\RecordNotFoundException] Previous logged'),
-                $this->stringContains('vendor/phpunit/phpunit/src/Framework/TestCase.php'),
+                $this->stringContains(str_replace('/', DS, 'vendor/phpunit/phpunit/src/Framework/TestCase.php')),
                 $this->stringContains('Request URL: /target/url'),
                 $this->stringContains('Referer URL: /other/path')
             ));