File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
dev/tests/integration/testsuite/Magento/Framework/DataObject Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \Framework \DataObject ;
7
+
8
+ class IdentityValidatorTest extends \PHPUnit \Framework \TestCase
9
+ {
10
+ const VALID_UUID = 'fe563e12-cf9d-4faf-82cd-96e011b557b7 ' ;
11
+ const INVALID_UUID = 'abcdef ' ;
12
+
13
+ /**
14
+ * @var IdentityValidator
15
+ */
16
+ protected $ identityValidator ;
17
+
18
+ protected function setUp ()
19
+ {
20
+ $ this ->identityValidator = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()
21
+ ->get (IdentityValidator::class);
22
+ }
23
+
24
+ public function testIsValid ()
25
+ {
26
+ $ isValid = $ this ->identityValidator ->isValid (self ::VALID_UUID );
27
+ $ this ->assertEquals (true , $ isValid );
28
+ }
29
+
30
+ public function testIsNotValid ()
31
+ {
32
+ $ isValid = $ this ->identityValidator ->isValid (self ::INVALID_UUID );
33
+ $ this ->assertEquals (false , $ isValid );
34
+ }
35
+
36
+ public function testEmptyValue ()
37
+ {
38
+ $ isValid = $ this ->identityValidator ->isValid ('' );
39
+ $ this ->assertEquals (false , $ isValid );
40
+ }
41
+ }
You can’t perform that action at this time.
0 commit comments