Page MenuHomeDevCentral

Ensure ItemGroupMapping::$items is always an array
ClosedPublic

Authored by dereckson on Apr 9 2017, 12:16.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 20:15
Unknown Object (File)
Tue, Dec 17, 09:50
Unknown Object (File)
Tue, Dec 17, 00:38
Unknown Object (File)
Fri, Dec 13, 02:51
Unknown Object (File)
Wed, Dec 11, 01:00
Unknown Object (File)
Mon, Dec 9, 10:38
Unknown Object (File)
Sun, Dec 8, 14:20
Unknown Object (File)
Sun, Dec 8, 14:20
Subscribers
None

Details

Summary

When a JSON configuration file omits an array, we can assume
the configuration author intent is to pass an empty array.

Fixes T1179.

Test Plan

A new unit test is provided, to ensure the payload is well
expanded with an empty array and not a null value.

The tests correctly fails before the fix and passes after:

-    'items' => null
+    'items' => Array ()

Diff Detail

Repository
rNOTIF Notifications center
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson added inline comments.
tests/Analyzers/ItemGroupMappingTest.php
10

Extraneous (a data provider is called before setUp, so we can't initialize app, and actually we don't need to)

52

They are ItemGroupMapping.

This revision is now accepted and ready to land.Apr 9 2017, 12:18
This revision was automatically updated to reflect the committed changes.