EcomDev_PHPUnit icon indicating copy to clipboard operation
EcomDev_PHPUnit copied to clipboard

Notice: Undefined offset: 2

Open jamby77 opened this issue 12 years ago • 0 comments

Notice: Undefined offset: 2 in /lib/EcomDev/PHPUnit/Constraint/Controller/Request.php on line 86

The above happens when parsing route of type 'module/action'. When route is exploded it has 2 fields, code on line 86 tries to pad the array, but uses array_pad in wrong way, it should be:

$routeParts = array_pad($routeParts, 3, null);

and not

array_pad($routeParts, 3-$routePartsCount, null);

PHP v.5.3.15 From manual: array_pad() returns a copy of the input padded to size specified by pad_size with value pad_value.

jamby77 avatar Feb 13 '13 21:02 jamby77