Bläddra i källkod

Fixed tests any() to never()

* All tests where done thinking any() was never()
* All instances replaced. Tests where ok indeed.
mmoreram 11 år sedan
förälder
incheckning
0ee9b969a2
2 ändrade filer med 20 tillägg och 20 borttagningar
  1. 16 16
      Tests/Module/WorkerClassTest.php
  2. 4 4
      Tests/Service/GearmanParserTest.php

+ 16 - 16
Tests/Module/WorkerClassTest.php

@@ -2,7 +2,7 @@
 
 /**
  * Gearman Bundle for Symfony2
- * 
+ *
  * @author Marc Morera <yuhu@mmoreram.com>
  * @since 2013
  */
@@ -22,7 +22,7 @@ class WorkerClassTest extends \PHPUnit_Framework_TestCase
 
     /**
      * @var WorkAnnotation
-     * 
+     *
      * Worker annotation driver
      */
     private $workAnnotation;
@@ -30,7 +30,7 @@ class WorkerClassTest extends \PHPUnit_Framework_TestCase
 
     /**
      * @var \ReflectionClass
-     * 
+     *
      * Reflection Class
      */
     private $reflectionClass;
@@ -38,7 +38,7 @@ class WorkerClassTest extends \PHPUnit_Framework_TestCase
 
     /**
      * @var Reader
-     * 
+     *
      * Reader
      */
     private $reader;
@@ -46,7 +46,7 @@ class WorkerClassTest extends \PHPUnit_Framework_TestCase
 
     /**
      * @var string
-     * 
+     *
      * Class namespace
      */
     private $classNamespace = 'MyClassNamespace';
@@ -54,7 +54,7 @@ class WorkerClassTest extends \PHPUnit_Framework_TestCase
 
     /**
      * @var string
-     * 
+     *
      * Class name
      */
     private $className = 'myClass';
@@ -62,7 +62,7 @@ class WorkerClassTest extends \PHPUnit_Framework_TestCase
 
     /**
      * @var string
-     * 
+     *
      * Filename
      */
     private $fileName = 'myClass.php';
@@ -70,7 +70,7 @@ class WorkerClassTest extends \PHPUnit_Framework_TestCase
 
     /**
      * @var array
-     * 
+     *
      * Servers list
      */
     private $servers = array(
@@ -83,7 +83,7 @@ class WorkerClassTest extends \PHPUnit_Framework_TestCase
 
     /**
      * @var array
-     * 
+     *
      * Default settings
      */
     private $defaultSettings = array(
@@ -130,9 +130,9 @@ class WorkerClassTest extends \PHPUnit_Framework_TestCase
 
     /**
      * Testing scenario with all Job annotations filled
-     * 
+     *
      * All settings given in annotations should be considered to configure Job
-     * 
+     *
      * Also testing server definition in JobAnnotation as an array of arrays ( multi server )
      */
     public function testWorkerAnnotationsDefined()
@@ -164,7 +164,7 @@ class WorkerClassTest extends \PHPUnit_Framework_TestCase
 
         $this
             ->reader
-            ->expects($this->any())
+            ->expects($this->never())
             ->method('getMethodAnnotations');
 
         $this->workAnnotation->name = 'myOtherWorkerName';
@@ -197,9 +197,9 @@ class WorkerClassTest extends \PHPUnit_Framework_TestCase
 
     /**
      * Testing scenario with any Job annotation filled
-     * 
+     *
      * All settings set as default should be considered to configure Job
-     * 
+     *
      * Also testing empty server definition in JobAnnotation
      */
     public function testWorkerAnnotationsEmpty()
@@ -231,7 +231,7 @@ class WorkerClassTest extends \PHPUnit_Framework_TestCase
 
         $this
             ->reader
-            ->expects($this->any())
+            ->expects($this->never())
             ->method('getMethodAnnotations');
 
         $workerClass = new WorkerClass($this->workAnnotation, $this->reflectionClass, $this->reader, $this->servers, $this->defaultSettings);
@@ -282,7 +282,7 @@ class WorkerClassTest extends \PHPUnit_Framework_TestCase
 
         $this
             ->reader
-            ->expects($this->any())
+            ->expects($this->never())
             ->method('getMethodAnnotations');
 
         $this->workAnnotation->servers = array(

+ 4 - 4
Tests/Service/GearmanParserTest.php

@@ -124,7 +124,7 @@ class GearmanParserTest extends WebTestCase
     {
 
         $this->bundleMock
-            ->expects($this->any())
+            ->expects($this->once())
             ->method('getPath')
             ->will($this->returnValue($this->bundlePath));
 
@@ -154,7 +154,7 @@ class GearmanParserTest extends WebTestCase
     {
 
         $this->bundleMock
-            ->expects($this->any())
+            ->expects($this->once())
             ->method('getPath')
             ->will($this->returnValue($this->bundlePath));
 
@@ -190,7 +190,7 @@ class GearmanParserTest extends WebTestCase
     {
 
         $this->bundleMock
-            ->expects($this->any())
+            ->expects($this->once())
             ->method('getPath')
             ->will($this->returnValue($this->bundlePath));
 
@@ -287,7 +287,7 @@ class GearmanParserTest extends WebTestCase
             ->getMock();
 
         $finder
-            ->expects($this->any())
+            ->expects($this->never())
             ->method('getPath');
 
         $workerCollection = $this