Browse Source

Updating PHPUnit version to ~4.0 along with some tests

Jonny Wenmoth 11 years ago
parent
commit
99882f19a1

+ 1 - 0
bin/phpunit

@@ -0,0 +1 @@
+../vendor/phpunit/phpunit/phpunit

+ 1 - 1
composer.json

@@ -22,7 +22,7 @@
         "jakoch/phantomjs-installer": "1.9.7"
     },
     "require-dev": {
-        "phpunit/phpunit": "3.7.*"
+        "phpunit/phpunit": "~4.0"
     },
     "autoload": {
         "psr-0": {

+ 1 - 2
src/JonnyW/PhantomJs/Tests/Integration/Template/TemplateRendererTest.php

@@ -69,8 +69,7 @@ class TemplateRendererTest extends TestCase
         $template = 'var param = {{ request.getTimeout() }}';
 
         $request = $this->getRequest();
-        $request->expects($this->any())
-            ->method('getTimeout')
+        $request->method('getTimeout')
             ->will($this->returnValue(5000));
 
         $renderer = $this->getInjectedTemplateRenderer();

+ 1 - 2
src/JonnyW/PhantomJs/Tests/Unit/Cache/FileCacheTest.php

@@ -94,8 +94,7 @@ class FileCacheTest extends \PHPUnit_Framework_TestCase
         $this->setExpectedException('\JonnyW\PhantomJs\Exception\NotWritableException');
 
         $fileCache = $this->getMockFileCache(array('writeData'), $this->directory, 'txt');
-        $fileCache->expects($this->any())
-            ->method('writeData')
+        $fileCache->method('writeData')
             ->will($this->returnValue(false));
 
         $fileCache->save($this->filename, 'Test');

+ 2 - 4
src/JonnyW/PhantomJs/Tests/Unit/Procedure/ChainProcedureLoaderTest.php

@@ -51,8 +51,7 @@ class ChainProcedureLoaderTest extends \PHPUnit_Framework_TestCase
         $this->setExpectedException('\InvalidArgumentException');
 
         $procedureLoader = $this->getProcedureLoader();
-        $procedureLoader->expects($this->any())
-            ->method('load')
+        $procedureLoader->method('load')
             ->will($this->throwException(new \Exception()));
 
         $procedureLoaders = array(
@@ -74,8 +73,7 @@ class ChainProcedureLoaderTest extends \PHPUnit_Framework_TestCase
         $procedure = $this->getProcedure();
 
         $procedureLoader = $this->getProcedureLoader();
-        $procedureLoader->expects($this->any())
-            ->method('load')
+        $procedureLoader->method('load')
             ->will($this->returnValue($procedure));
 
         $procedureLoaders = array(

+ 6 - 12
src/JonnyW/PhantomJs/Tests/Unit/Procedure/ProcedureLoaderTest.php

@@ -53,8 +53,7 @@ class ProcedureLoaderTest extends \PHPUnit_Framework_TestCase
         $procedureFactory = $this->getProcedureFactory();
         $fileLocator      = $this->getFileLocator();
 
-        $fileLocator->expects($this->any())
-            ->method('locate')
+        $fileLocator->method('locate')
             ->will($this->returnValue('http://example.com/index.html'));
 
         $procedureLoader = $this->getProcedureLoader($procedureFactory, $fileLocator);
@@ -75,8 +74,7 @@ class ProcedureLoaderTest extends \PHPUnit_Framework_TestCase
         $procedureFactory = $this->getProcedureFactory();
         $fileLocator      = $this->getFileLocator();
 
-        $fileLocator->expects($this->any())
-            ->method('locate')
+        $fileLocator->method('locate')
             ->will($this->returnValue('/invalid/file.proc'));
 
         $procedureLoader = $this->getProcedureLoader($procedureFactory, $fileLocator);
@@ -98,12 +96,10 @@ class ProcedureLoaderTest extends \PHPUnit_Framework_TestCase
         $fileLocator      = $this->getFileLocator();
         $procedure        = $this->getProcedure();
 
-        $fileLocator->expects($this->any())
-            ->method('locate')
+        $fileLocator->method('locate')
             ->will($this->returnValue($file));
 
-        $procedureFactory->expects($this->any())
-            ->method('createProcedure')
+        $procedureFactory->method('createProcedure')
             ->will($this->returnValue($procedure));
 
         $procedureLoader = $this->getProcedureLoader($procedureFactory, $fileLocator);
@@ -127,12 +123,10 @@ class ProcedureLoaderTest extends \PHPUnit_Framework_TestCase
         $fileLocator      = $this->getFileLocator();
         $procedure        = $this->getProcedure();
 
-        $fileLocator->expects($this->any())
-            ->method('locate')
+        $fileLocator->method('locate')
             ->will($this->returnValue($file));
 
-        $procedureFactory->expects($this->any())
-            ->method('createProcedure')
+        $procedureFactory->method('createProcedure')
             ->will($this->returnValue($procedure));
 
         $procedureLoader = $this->getProcedureLoader($procedureFactory, $fileLocator);