Issues

ZF2-54: Default value is not corresponding with the Unit Test

Description

The Unit test of ZendTest\Controller\Action\Helper\AutoCompleteTest is expecting the static method JSON::decode to return an array by default. While it is returning an StdObject by default.


/**
     * Decodes the given $encodedValue string which is
     * encoded in the JSON format
     *
     * Uses ext/json's json_decode if available.
     *
     * @param string $encodedValue Encoded in JSON format
     * @param int $objectDecodeType Optional; flag indicating how to decode
     * objects. See {@link Zend_Json_Decoder::decode()} for details.
     * @return mixed
     * @throws Zend\Json\Exception\RuntimeException
     */
public static function decode($encodedValue, $objectDecodeType = self::TYPE_OBJECT) 

So either the Unit is wrong or the code is wrong.

Comments

In ZF1, the default value was self::TYPE_ARRAY. So I would suggest to make the change in the code and leave the Unit Testing code as it is.

Watch the commit f7858ef.

Already fixed in the master.