Skip to content

Commit 0b99f29

Browse files
committed
add basic functional test
1 parent 3a7bfdc commit 0b99f29

File tree

5 files changed

+81
-0
lines changed

5 files changed

+81
-0
lines changed

tests/Maker/MakeResetPasswordTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Bundle\MakerBundle\Test\MakerTestCase;
1616
use Symfony\Bundle\MakerBundle\Test\MakerTestDetails;
1717
use Symfony\Component\Filesystem\Filesystem;
18+
use Symfony\Component\Yaml\Yaml;
1819

1920
class MakeResetPasswordTest extends MakerTestCase
2021
{
@@ -58,5 +59,23 @@ function (string $output, string $directory) {
5859
}
5960
)
6061
];
62+
63+
yield 'reset_password_functional_test' => [MakerTestDetails::createTest(
64+
$this->getMakerInstance(MakeResetPassword::class),
65+
[
66+
'App\Entity\User',
67+
'app_home',
68+
69+
'SymfonyCasts',
70+
])
71+
->addExtraDependencies('doctrine')
72+
->addExtraDependencies('doctrine/annotations')
73+
->addExtraDependencies('mailer')
74+
->addExtraDependencies('security-bundle')
75+
->addExtraDependencies('symfony/form')
76+
->addExtraDependencies('symfony/validator')
77+
->addExtraDependencies('twig')
78+
->setFixtureFilesPath(__DIR__.'/../fixtures/MakeResetPasswordFunctionalTest')
79+
];
6180
}
6281
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
framework:
2+
mailer:
3+
dsn: 'null://null'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
security:
2+
encoders:
3+
App\Entity\User: bcrypt
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
namespace App\Entity;
4+
5+
use Symfony\Component\Security\Core\User\UserInterface;
6+
7+
class User implements UserInterface
8+
{
9+
10+
private $email;
11+
12+
public function getEmail()
13+
{
14+
}
15+
16+
public function getRoles()
17+
{
18+
}
19+
20+
public function getPassword()
21+
{
22+
}
23+
24+
public function setPassword()
25+
{
26+
}
27+
28+
public function getSalt()
29+
{
30+
}
31+
32+
public function getUsername()
33+
{
34+
}
35+
36+
public function eraseCredentials()
37+
{
38+
}
39+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace App\Tests;
4+
5+
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
6+
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
7+
8+
class ResetPasswordFunctionalTest extends WebTestCase
9+
{
10+
public function testResetPassword()
11+
{
12+
$client = static::createClient();
13+
$client->request('GET', '/reset-password');
14+
15+
$this->assertSame(200, $client->getResponse()->getStatusCode());
16+
}
17+
}

0 commit comments

Comments
 (0)