-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔃 [Magento Community Engineering] Community Contributions - 2.4-devel…
…op daily delivery Accepted Community Pull Requests: - #26378: 26375 braintree payment address issue (by @chris-pook) - #25641: M2C-21768 Validate product quantity on Wishlist update (by @ptylek) - #25285: Add lib wrapper for UUID validation. (by @nikolaevas) Fixed GitHub Issues: - #26375: Switching billing address causes Javascript function text to render in front-end checkout payment section (reported by @chris-pook) has been fixed in #26378 by @chris-pook in 2.4-develop branch Related commits: 1. 4ea41d0 2. ee3f8e3 3. 5427099 - #25032: Display some error "We can't update your Wish List right now." at wish list (reported by @renard123) has been fixed in #25641 by @ptylek in 2.4-develop branch Related commits: 1. a5a2cbc 2. 5415e99 3. b2fc304 4. b398206
- Loading branch information
Showing
8 changed files
with
133 additions
and
5 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
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
41 changes: 41 additions & 0 deletions
41
dev/tests/integration/testsuite/Magento/Framework/DataObject/IdentityValidatorTest.php
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,41 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Framework\DataObject; | ||
|
||
class IdentityValidatorTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
const VALID_UUID = 'fe563e12-cf9d-4faf-82cd-96e011b557b7'; | ||
const INVALID_UUID = 'abcdef'; | ||
|
||
/** | ||
* @var IdentityValidator | ||
*/ | ||
protected $identityValidator; | ||
|
||
protected function setUp() | ||
{ | ||
$this->identityValidator = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() | ||
->get(IdentityValidator::class); | ||
} | ||
|
||
public function testIsValid() | ||
{ | ||
$isValid = $this->identityValidator->isValid(self::VALID_UUID); | ||
$this->assertEquals(true, $isValid); | ||
} | ||
|
||
public function testIsNotValid() | ||
{ | ||
$isValid = $this->identityValidator->isValid(self::INVALID_UUID); | ||
$this->assertEquals(false, $isValid); | ||
} | ||
|
||
public function testEmptyValue() | ||
{ | ||
$isValid = $this->identityValidator->isValid(''); | ||
$this->assertEquals(false, $isValid); | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
lib/internal/Magento/Framework/DataObject/IdentityValidator.php
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,27 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Framework\DataObject; | ||
|
||
use Ramsey\Uuid\Uuid; | ||
|
||
/** | ||
* Class IdentityValidator | ||
* | ||
* Class for validating Uuid's | ||
*/ | ||
class IdentityValidator implements IdentityValidatorInterface | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
public function isValid(string $value): bool | ||
{ | ||
$isValid = Uuid::isValid($value); | ||
return $isValid; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
lib/internal/Magento/Framework/DataObject/IdentityValidatorInterface.php
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,21 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Framework\DataObject; | ||
|
||
/** | ||
* Interface IdentityValidatorInterface | ||
*/ | ||
interface IdentityValidatorInterface | ||
{ | ||
/** | ||
* Checks if uuid is valid | ||
* | ||
* @param string $value | ||
* | ||
* @return bool | ||
*/ | ||
public function isValid(string $value): bool; | ||
} |
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