FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
forms/tests/Validators/MaxLengthValidatorTest.php at main · mintyphp/forms · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
mintyphp
/
forms
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
forms
/
tests
/
Validators
/
MaxLengthValidatorTest.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (38 loc) · 1.2 KB
Breadcrumbs
forms
/
tests
/
Validators
/
MaxLengthValidatorTest.php
Copy path
File metadata and controls
42 lines (38 loc) · 1.2 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace
MintyPHP
\
Tests
\
Validators
;
use
MintyPHP
\
Form
\
Validator
\
Validators
;
use
PHPUnit
\
Framework
\
Attributes
\
DataProvider
;
use
PHPUnit
\
Framework
\
TestCase
;
class
MaxLengthValidatorTest
extends
TestCase
{
public
static
function
maxLengthDataProvider
():
array
{
return
[
[
''
,
0
,
true
],
[
''
,
1
,
true
],
[
'
😜
'
,
0
,
false
],
[
'
😜
'
,
1
,
true
],
[
'
😜
'
,
2
,
true
],
[
'
12
'
,
1
,
false
],
[
'
12
'
,
2
,
true
],
[
'
12
'
,
3
,
true
],
[
'
123 78
'
,
7
,
false
],
[
'
123 78
'
,
8
,
true
],
[
'
123 78
'
,
9
,
true
],
[
'
12345
'
,
4
,
false
],
[
'
12345
'
,
5
,
true
],
[
'
12345
'
,
6
,
true
],
[
'
12345
'
,
7
,
true
],
[
'
45678
'
,
4
,
false
],
[
'
45678
'
,
5
,
true
],
[
'
45678
'
,
6
,
true
],
[
'
45678
'
,
7
,
true
],
];
}
#[DataProvider(
'
maxLengthDataProvider
'
)]
public
function
testValidExpression
(
string
$
input
,
int
$
length
,
bool
$
expected
):
void
{
$
validator
= Validators::
maxLength
(
$
length
,
'
invalid length
'
);
$
this
->
assertEquals
(
$
validator
->
validate
(
$
input
) ===
''
,
$
expected
);
}
}
Back
|
FazBrowse Home
|
New Git URL