diff --git a/app/code/Magento/Customer/Model/Customer/Source/Group.php b/app/code/Magento/Customer/Model/Customer/Source/Group.php index 98cba5dd555a9..e4c1d2e75be22 100644 --- a/app/code/Magento/Customer/Model/Customer/Source/Group.php +++ b/app/code/Magento/Customer/Model/Customer/Source/Group.php @@ -56,7 +56,7 @@ public function toOptionArray() $customerGroups = []; $customerGroups[] = [ 'label' => __('ALL GROUPS'), - 'value' => GroupInterface::CUST_GROUP_ALL, + 'value' => (string)GroupInterface::CUST_GROUP_ALL, ]; /** @var GroupSearchResultsInterface $groups */ diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/Source/GroupTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/Source/GroupTest.php index e93d81c45fda4..78148fac3a9a6 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Customer/Source/GroupTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/Source/GroupTest.php @@ -71,8 +71,8 @@ protected function setUp() public function testToOptionArray() { $customerGroups = [ - ['label' => __('ALL GROUPS'), 'value' => 32000], - ['label' => __('NOT LOGGED IN'), 'value' => 0] + ['label' => __('ALL GROUPS'), 'value' => '32000'], + ['label' => __('NOT LOGGED IN'), 'value' => '0'], ]; $this->moduleManagerMock->expects($this->any()) @@ -95,11 +95,17 @@ public function testToOptionArray() ->setMethods(['getCode', 'getId']) ->getMockForAbstractClass(); $groupTest->expects($this->any())->method('getCode')->willReturn(__('NOT LOGGED IN')); - $groupTest->expects($this->any())->method('getId')->willReturn(0); + $groupTest->expects($this->any())->method('getId')->willReturn('0'); $groups = [$groupTest]; $this->searchResultMock->expects($this->any())->method('getItems')->willReturn($groups); - $this->assertEquals($customerGroups, $this->model->toOptionArray()); + $actualCustomerGroups = $this->model->toOptionArray(); + + $this->assertEquals($customerGroups, $actualCustomerGroups); + + foreach ($actualCustomerGroups as $actualCustomerGroup) { + $this->assertInternalType('string', $actualCustomerGroup['value']); + } } }