php - PHPUnit mock Missing argument 1 for Mock called in -


$reflectionclassmock = $this->createmock(\reflectionclass::class); $reflectionclassmock->method('issubclassof')->willreturn(true); $reflectionclassmock->method('newinstance')->willreturn($middlewaremock); 

class testing code:

foreach ($reflectionmethod->getparameters() $parameter) {             $reflectionparameter = $this->loadreflectionparameter(get_class($controller[0]), $method, $parameter);             $classreflection = $reflectionparameter->getclass();              if ($classreflection->issubclassof(middlewareinterface::class)) {                 /** @var middlewareinterface $middleware */                 $middleware = $classreflection->newinstance();                 $middleware->handle($request, $tokenstorage);             }         } 

missing argument 1 mock_reflectionclass_b235823b::newinstance(), called in /var/www/kwork/src/middlewarebundle/eventsubscriber/argumentbagsubscriber.php on line 55 , defined


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -