Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
Validator
Test
Unit
StringLengthTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\Validator\Test\Unit
;
8
12
class
StringLengthTest
extends
\PHPUnit\Framework\TestCase
13
{
17
protected
$_validator
;
18
19
protected
function
setUp
()
20
{
21
$this->_validator = new \Magento\Framework\Validator\StringLength();
22
}
23
24
public
function
testDefaultEncoding
()
25
{
26
$this->assertEquals(
'UTF-8'
, $this->_validator->getEncoding());
27
}
28
35
public
function
testIsValid
(
$value
, $maxLength, $isValid)
36
{
37
$this->_validator->setMax($maxLength);
38
$this->assertEquals($isValid, $this->_validator->isValid(
$value
));
39
}
40
44
public
function
isValidDataProvider
()
45
{
46
return
[
47
[
'строка'
, 6,
true
],
48
[
'строка'
, 5,
false
],
49
[
'string'
, 6,
true
],
50
[
'string'
, 5,
false
]
51
];
52
}
53
}
Magento\Framework\Validator\Test\Unit\StringLengthTest\testDefaultEncoding
testDefaultEncoding()
Definition:
StringLengthTest.php:24
Magento\Framework\Validator\Test\Unit\StringLengthTest
Definition:
StringLengthTest.php:12
Magento\Framework\Validator\Test\Unit\StringLengthTest\setUp
setUp()
Definition:
StringLengthTest.php:19
Magento\Framework\Validator\Test\Unit\StringLengthTest\$_validator
$_validator
Definition:
StringLengthTest.php:17
$value
$value
Definition:
gender.phtml:16
Magento\Framework\Validator\Test\Unit\StringLengthTest\isValidDataProvider
isValidDataProvider()
Definition:
StringLengthTest.php:44
Magento\Framework\Validator\Test\Unit
Definition:
BuilderTest.php:6
Magento\Framework\Validator\Test\Unit\StringLengthTest\testIsValid
testIsValid($value, $maxLength, $isValid)
Definition:
StringLengthTest.php:35