Skip to content

Commit d8a5886

Browse files
committed
MC-33070: Make Integration tests compatible with PHPUnit9
1 parent 34fcec3 commit d8a5886

File tree

254 files changed

+1283
-1078
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+1283
-1078
lines changed

app/code/Magento/Eav/Model/Entity/AbstractEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ public function load($object, $entityId, $attributes = [])
993993
$select = $this->_getLoadRowSelect($object, $entityId);
994994
$row = $this->getConnection()->fetchRow($select);
995995

996-
if (is_array($row)) {
996+
if (is_array($row) && !empty($row)) {
997997
$object->addData($row);
998998
$this->loadAttributesForObject($attributes, $object);
999999

app/code/Magento/User/Model/User.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\Backend\Model\Auth\Credential\StorageInterface;
1010
use Magento\Framework\App\ObjectManager;
11+
use Magento\Framework\Exception\LocalizedException;
1112
use Magento\Framework\Model\AbstractModel;
1213
use Magento\Framework\Exception\AuthenticationException;
1314
use Magento\Framework\Serialize\Serializer\Json;
@@ -38,27 +39,27 @@
3839
class User extends AbstractModel implements StorageInterface, UserInterface
3940
{
4041
/**
41-
* @deprecated
42+
* @deprecated New functionality has been added
4243
* @see \Magento\User\Model\Spi\NotificatorInterface
4344
*/
4445
const XML_PATH_FORGOT_EMAIL_TEMPLATE = 'admin/emails/forgot_email_template';
4546

4647
/**
47-
* @deprecated
48+
* @deprecated New functionality has been added
4849
* @see \Magento\User\Model\Spi\NotificatorInterface
4950
*/
5051
const XML_PATH_FORGOT_EMAIL_IDENTITY = 'admin/emails/forgot_email_identity';
5152

5253
/**
53-
* @deprecated
54+
* @deprecated New functionality has been added
5455
* @see \Magento\User\Model\Spi\NotificatorInterface
5556
*/
5657
const XML_PATH_USER_NOTIFICATION_TEMPLATE = 'admin/emails/user_notification_template';
5758

5859
/**
5960
* Configuration paths for admin user reset password email template
6061
*
61-
* @deprecated
62+
* @deprecated New functionality has been added
6263
*/
6364
const XML_PATH_RESET_PASSWORD_TEMPLATE = 'admin/emails/reset_password_template';
6465

@@ -399,7 +400,7 @@ public function saveExtra($data)
399400
* Retrieve user roles
400401
*
401402
* @return array
402-
* @throws \Magento\Framework\Exception\LocalizedException
403+
* @throws LocalizedException
403404
*/
404405
public function getRoles()
405406
{
@@ -566,7 +567,7 @@ public function getAclRole()
566567
* @param string $username
567568
* @param string $password
568569
* @return bool
569-
* @throws \Magento\Framework\Exception\LocalizedException
570+
* @throws LocalizedException
570571
*/
571572
public function authenticate($username, $password)
572573
{
@@ -588,7 +589,7 @@ public function authenticate($username, $password)
588589
'admin_user_authenticate_after',
589590
['username' => $username, 'password' => $password, 'user' => $this, 'result' => $result]
590591
);
591-
} catch (\Magento\Framework\Exception\LocalizedException $e) {
592+
} catch (LocalizedException $e) {
592593
$this->unsetData();
593594
throw $e;
594595
}
@@ -632,7 +633,7 @@ public function verifyIdentity($password)
632633
* @param string $username
633634
* @param string $password
634635
* @return $this
635-
* @throws \Magento\Framework\Exception\LocalizedException
636+
* @throws LocalizedException
636637
*/
637638
public function login($username, $password)
638639
{
@@ -665,7 +666,7 @@ public function loadByUsername($username)
665666
{
666667
$data = $this->getResource()->loadByUsername($username);
667668
if ($data !== false) {
668-
if (is_string($data['extra'])) {
669+
if (isset($data['extra']) && is_string($data['extra'])) {
669670
$data['extra'] = $this->serializer->unserialize($data['extra']);
670671
}
671672

@@ -678,7 +679,7 @@ public function loadByUsername($username)
678679
/**
679680
* Check if user is assigned to any role
680681
*
681-
* @param int|\Magento\User\Model\User $user
682+
* @param int|User $user
682683
* @return null|array
683684
*/
684685
public function hasAssigned2Role($user)
@@ -704,12 +705,12 @@ protected function _getEncodedPassword($password)
704705
*
705706
* @param string $newToken
706707
* @return $this
707-
* @throws \Magento\Framework\Exception\LocalizedException
708+
* @throws LocalizedException
708709
*/
709710
public function changeResetPasswordLinkToken($newToken)
710711
{
711712
if (!is_string($newToken) || empty($newToken)) {
712-
throw new \Magento\Framework\Exception\LocalizedException(
713+
throw new LocalizedException(
713714
__('The password reset token is incorrect. Verify the token and try again.')
714715
);
715716
}

0 commit comments

Comments
 (0)