Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
framadate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nounous
framadate
Commits
6f257f41
Commit
6f257f41
authored
6 years ago
by
m
Browse files
Options
Downloads
Patches
Plain Diff
fix code style
parent
599f3104
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/classes/Framadate/Services/InputService.php
+0
-1
0 additions, 1 deletion
app/classes/Framadate/Services/InputService.php
app/tests/Framadate/Services/InputServiceUnitTest.php
+6
-14
6 additions, 14 deletions
app/tests/Framadate/Services/InputServiceUnitTest.php
with
6 additions
and
15 deletions
app/classes/Framadate/Services/InputService.php
+
0
−
1
View file @
6f257f41
...
@@ -67,7 +67,6 @@ class InputService {
...
@@ -67,7 +67,6 @@ class InputService {
}
}
public
function
filterMail
(
$mail
)
{
public
function
filterMail
(
$mail
)
{
///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
// formatting
// formatting
...
...
This diff is collapsed.
Click to expand it.
app/tests/Framadate/Services/InputServiceUnitTest.php
+
6
−
14
View file @
6f257f41
...
@@ -3,26 +3,20 @@ namespace Framadate\Services;
...
@@ -3,26 +3,20 @@ namespace Framadate\Services;
use
Framadate\FramaTestCase
;
use
Framadate\FramaTestCase
;
class
InputServiceUnitTest
extends
FramaTestCase
{
class
InputServiceUnitTest
extends
FramaTestCase
{
/**
/**
* @test
* @test
* @dataProvider liste_emails
* @dataProvider liste_emails
*/
*/
function
test_filterMail
(
$email
,
$expected
)
function
test_filterMail
(
$email
,
$expected
)
{
{
$inputService
=
new
InputService
();
$inputService
=
new
InputService
();
$filtered
=
$inputService
->
filterMail
(
$email
);
$filtered
=
$inputService
->
filterMail
(
$email
);
$this
->
assertSame
(
$expected
,
$filtered
);
$this
->
assertSame
(
$expected
,
$filtered
);
}
}
function
liste_emails
()
{
function
liste_emails
()
{
return
[
return
[
// valids addresses
// valids addresses
"valid address"
=>
[
"example@example.com"
,
"example@example.com"
],
"valid address"
=>
[
"example@example.com"
,
"example@example.com"
],
...
@@ -32,10 +26,8 @@ class InputServiceUnitTest extends FramaTestCase {
...
@@ -32,10 +26,8 @@ class InputServiceUnitTest extends FramaTestCase {
"unicode caracters"
=>
[
"unicode.éà@idn-œ.com"
,
"unicode.éà@idn-œ.com"
],
"unicode caracters"
=>
[
"unicode.éà@idn-œ.com"
,
"unicode.éà@idn-œ.com"
],
// invalids addresses
// invalids addresses
"without domain"
=>
[
"without-domain"
,
FALSE
],
"without domain"
=>
[
"without-domain"
,
FALSE
],
"space inside"
=>
[
"example @example.com"
,
FALSE
],
"space inside"
=>
[
"example
example
@example.com"
,
FALSE
],
"forbidden chars"
=>
[
"special_chars.
)#
@example.com"
,
FALSE
],
"forbidden chars"
=>
[
"special_chars.@example.com"
,
FALSE
],
];
];
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment