Page MenuHomeDevCentral

Ensure ItemGroupMapping::$items is always an array
ClosedPublic

Authored by dereckson on Apr 9 2017, 12:16.
Tags
None
Referenced Files
F3753216: D947.diff
Mon, Nov 18, 00:01
F3752868: D947.id.diff
Sun, Nov 17, 21:49
Unknown Object (File)
Thu, Nov 14, 15:06
Unknown Object (File)
Tue, Nov 12, 12:04
Unknown Object (File)
Tue, Nov 12, 09:16
Unknown Object (File)
Tue, Nov 12, 08:11
Unknown Object (File)
Tue, Nov 12, 06:20
Unknown Object (File)
Mon, Nov 11, 18:40
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.