/** * @param ResultRecordInterface $record * @param array $actions * * @return array */ public function getCustomerActionsPermissions(ResultRecordInterface $record, array $actions) { $isChannelApplicable = $this->isChannelApplicable($record, false); $permissions = parent::getActionsPermissions($record, $actions); if (array_key_exists('update', $permissions)) { $permissions['update'] = $isChannelApplicable; } return $permissions; }
/** * @param ResultRecordInterface $record * @param array $actions * @param array $expected * @param bool $isAllowed * * @dataProvider permissionsDataProvider */ public function testGetActionsPermissions(ResultRecordInterface $record, array $actions, array $expected, $isAllowed) { $this->settingsProvider->expects($this->any())->method('isChannelApplicable')->will($this->returnValue(true)); $this->securityFacade->expects($this->any())->method('isGranted')->will($this->returnValue($isAllowed)); $this->assertEquals($expected, $this->provider->getActionsPermissions($record, $actions)); }