Page MenuHomeDevCentral

Ensure ItemGroupMapping::$items is always an array
ClosedPublic

Authored by dereckson on Apr 9 2017, 12:16.
Tags
None
Referenced Files
F2746262: D947.id2413.diff
Fri, Mar 29, 02:01
Unknown Object (File)
Wed, Mar 27, 14:17
Unknown Object (File)
Fri, Mar 22, 07:48
Unknown Object (File)
Tue, Mar 19, 17:34
Unknown Object (File)
Tue, Mar 19, 17:03
Unknown Object (File)
Sun, Mar 17, 21:31
Unknown Object (File)
Wed, Mar 13, 14:06
Unknown Object (File)
Mon, Mar 11, 18:53
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.