Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
É
Éco-presto
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
COLLINOT Baptiste
Éco-presto
Commits
8316f959
Commit
8316f959
authored
1 year ago
by
DEMANGEL Mael
Browse files
Options
Downloads
Patches
Plain Diff
tests de la création de compte
parent
e2aad280
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
Makefile
+10
-0
10 additions, 0 deletions
Makefile
tests/TestConnexionTest.php
+102
-3
102 additions, 3 deletions
tests/TestConnexionTest.php
with
112 additions
and
3 deletions
Makefile
0 → 100644
+
10
−
0
View file @
8316f959
SHELL
:=
/bin/bash
tests
:
symfony console doctrine:database:drop
--force
--env
=
test
||
true
symfony console doctrine:database:create
--env
=
test
symfony console doctrine:migrations:migrate
-n
--env
=
test
symfony console doctrine:fixtures:load
-n
--env
=
test
symfony php bin/phpunit
.PHONY
:
tests
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/TestConnexionTest.php
+
102
−
3
View file @
8316f959
...
...
@@ -35,9 +35,108 @@ class TestConnexionTest extends WebTestCase
]);
// Vérifier si la redirection s'est faite après l'inscription réussie
$this
->
assertResponseRedirects
();
$this
->
assertResponseRedirects
(
'/login'
);
// Vérifier que l'utilisateur est inscrit en vérifiant la présence de son nom d'utilisateur par exemple
// $this->assertSelectorTextContains('p', 'test_user');
//On test le cas de deux identifiants identiques
$client
->
request
(
'GET'
,
'/register'
);
$client
->
submitForm
(
'inscription-btn'
,[
'registration_form[login]'
=>
'testCo'
,
'registration_form[plainPassword]'
=>
'testCo'
,
'registration_form[abonnement]'
=>
20
,
]);
$this
->
assertFalse
(
$client
->
getResponse
()
->
isRedirect
());
//On test le cas où le code postal est incorrect
$client
->
request
(
'GET'
,
'/register'
);
$client
->
submitForm
(
'inscription-btn'
,[
'registration_form[login]'
=>
'testCodePostal'
,
'registration_form[plainPassword]'
=>
'test'
,
'registration_form[code_postal]'
=>
123
,
'registration_form[abonnement]'
=>
20
,
]);
$this
->
assertFalse
(
$client
->
getResponse
()
->
isRedirect
());
$client
->
submitForm
(
'inscription-btn'
,[
'registration_form[login]'
=>
'testCodePostal'
,
'registration_form[plainPassword]'
=>
'test'
,
'registration_form[code_postal]'
=>
'abcde'
,
'registration_form[abonnement]'
=>
20
,
]);
$this
->
assertFalse
(
$client
->
getResponse
()
->
isRedirect
());
$client
->
submitForm
(
'inscription-btn'
,[
'registration_form[login]'
=>
'testCodePostal'
,
'registration_form[plainPassword]'
=>
'test'
,
'registration_form[code_postal]'
=>
12345
,
'registration_form[abonnement]'
=>
20
,
]);
$this
->
assertResponseRedirects
(
'/login'
);
//On test le cas où le numéro de téléphone est incorrect
$client
->
request
(
'GET'
,
'/register'
);
$client
->
submitForm
(
'inscription-btn'
,[
'registration_form[login]'
=>
'testTelephone'
,
'registration_form[plainPassword]'
=>
'test'
,
'registration_form[telephone]'
=>
123
,
'registration_form[abonnement]'
=>
20
,
]);
$this
->
assertFalse
(
$client
->
getResponse
()
->
isRedirect
());
$client
->
submitForm
(
'inscription-btn'
,[
'registration_form[login]'
=>
'testTelephone'
,
'registration_form[plainPassword]'
=>
'test'
,
'registration_form[telephone]'
=>
'abcdefghij'
,
'registration_form[abonnement]'
=>
20
,
]);
$this
->
assertFalse
(
$client
->
getResponse
()
->
isRedirect
());
$client
->
submitForm
(
'inscription-btn'
,[
'registration_form[login]'
=>
'testTelephone'
,
'registration_form[plainPassword]'
=>
'test'
,
'registration_form[telephone]'
=>
1234567890
,
'registration_form[abonnement]'
=>
20
,
]);
$this
->
assertResponseRedirects
(
'/login'
);
//On test le cas où l'email est incorrect
$client
->
request
(
'GET'
,
'/register'
);
$client
->
submitForm
(
'inscription-btn'
,[
'registration_form[login]'
=>
'testMail'
,
'registration_form[plainPassword]'
=>
'test'
,
'registration_form[email]'
=>
'test.mail.com'
,
'registration_form[abonnement]'
=>
20
,
]);
$this
->
assertFalse
(
$client
->
getResponse
()
->
isRedirect
());
$client
->
submitForm
(
'inscription-btn'
,[
'registration_form[login]'
=>
'testMail'
,
'registration_form[plainPassword]'
=>
'test'
,
'registration_form[email]'
=>
'test.mail@'
,
'registration_form[abonnement]'
=>
20
,
]);
$this
->
assertFalse
(
$client
->
getResponse
()
->
isRedirect
());
$client
->
submitForm
(
'inscription-btn'
,[
'registration_form[login]'
=>
'testMail'
,
'registration_form[plainPassword]'
=>
'test'
,
'registration_form[email]'
=>
'test.mail@gmail.fr'
,
'registration_form[abonnement]'
=>
20
,
]);
$this
->
assertResponseRedirects
(
'/login'
);
}
}
\ No newline at end of file
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