Skip to content
Permalink
Browse files

Adapt for v6.0 beta 3

  • Loading branch information...
MantasVaitkunas committed Mar 3, 2017
1 parent 192b174 commit 1875f053d4b99af123b651c0aa45ec048915c161
Showing with 63 additions and 0 deletions.
  1. +33 −0 UserUpdatableFields.php
  2. +1 −0 metadata.php
  3. +29 −0 tests/Integration/UserUpdatableFieldsTest.php
@@ -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);
}
}
@@ -28,6 +28,7 @@
'url' => 'http://www.oxid-esales.com',
'email' => 'mantas.vaitkunas@oxid-esales.com',
'extend' => array(
\OxidEsales\Eshop\Application\Model\User\UserUpdatableFields::class => \OxidEsales\ExtendUser\UserUpdatableFields::class
),
'events' => array(
'onActivate' => \OxidEsales\ExtendUser\ModuleEvents::class.'::onActivate',
@@ -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())
);
}
}

0 comments on commit 1875f05

Please sign in to comment.
You can’t perform that action at this time.