-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
192b174
commit 1875f05
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* @package extenduser | ||
* @category module | ||
* @author OXID eSales AG | ||
* @link http://www.oxid-esales.com/en/ | ||
* @licenses GNU GENERAL PUBLIC LICENSE. More info can be found in LICENSE file. | ||
* @copyright (C) OXID e-Sales, 2003-2017 | ||
*/ | ||
|
||
namespace OxidEsales\ExtendUser; | ||
|
||
/** | ||
* @see \OxidEsales\Eshop\Application\Model\User\UserUpdatableFields | ||
*/ | ||
class UserUpdatableFields extends UserUpdatableFields_parent | ||
{ | ||
protected $fieldsToAdd = [ | ||
UserModel::FIELD_ADDITIONAL_INFORMATION | ||
]; | ||
|
||
/** | ||
* Adds additional field which could be updated. | ||
* | ||
* @return array | ||
*/ | ||
public function getUpdatableFields() | ||
{ | ||
$updatableFields = parent::getUpdatableFields(); | ||
|
||
return array_merge($updatableFields, $this->fieldsToAdd); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* @package extenduser | ||
* @category module | ||
* @author OXID eSales AG | ||
* @link http://www.oxid-esales.com/en/ | ||
* @licenses GNU GENERAL PUBLIC LICENSE. More info can be found in LICENSE file. | ||
* @copyright (C) OXID e-Sales, 2003-2017 | ||
*/ | ||
|
||
namespace OxidEsales\ExtendUser\tests\Integration; | ||
|
||
use OxidEsales\Eshop\Application\Model\User\UserUpdatableFields; | ||
use OxidEsales\ExtendUser\UserModel; | ||
use OxidEsales\TestingLibrary\UnitTestCase; | ||
|
||
class UserUpdatableFieldsTest extends UnitTestCase | ||
{ | ||
public function testIsFieldAddedToWhiteList() | ||
{ | ||
/** @var UserUpdatableFields $userUpdatableFields */ | ||
$userUpdatableFields = oxNew(UserUpdatableFields::class); | ||
|
||
$this->assertTrue(in_array(UserModel::FIELD_ADDITIONAL_INFORMATION, $userUpdatableFields->getUpdatableFields()), | ||
'In updatable fields array missing field: '.UserModel::FIELD_ADDITIONAL_INFORMATION.'. Returned array is: ' | ||
.implode(" ",$userUpdatableFields->getUpdatableFields()) | ||
); | ||
} | ||
} |