| Conditions | 1 |
| Paths | 1 |
| Total Lines | 36 |
| Code Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | public function testResetPassword() |
||
| 10 | { |
||
| 11 | exec('./bin/console d:d:c --env=test'); |
||
| 12 | exec('./bin/console d:s:c --env=test'); |
||
| 13 | exec('./bin/console h:f:l -n --env=test'); |
||
| 14 | |||
| 15 | $client = static::createClient(); |
||
| 16 | $content = '{"email":"1"}'; |
||
| 17 | $client->request( |
||
| 18 | 'POST', |
||
| 19 | '/api/password_reset', |
||
| 20 | array(), |
||
| 21 | array(), |
||
| 22 | array('CONTENT_TYPE' => 'application/json'), |
||
| 23 | $content |
||
| 24 | |||
| 25 | ); |
||
| 26 | |||
| 27 | $this->assertEquals(404, $client->getResponse()->getStatusCode()); |
||
| 28 | |||
| 29 | $json = '{ |
||
| 30 | "email": "[email protected]" |
||
| 31 | }'; |
||
| 32 | |||
| 33 | $client->request('POST', '/api/password_reset', [], [], ['CONTENT_TYPE' => 'application/json'], $json |
||
| 34 | ); |
||
| 35 | $this->assertTrue( |
||
| 36 | $client->getResponse()->headers->contains( |
||
| 37 | 'Content-Type', |
||
| 38 | 'application/json' |
||
| 39 | ), |
||
| 40 | 'the "Content-Type" header is "application/json"' |
||
| 41 | ); |
||
| 42 | $this->assertTrue($client->getResponse()->isSuccessful(), 'response status is 2xx'); |
||
| 43 | exec('./bin/console d:d:d --force --env=test'); |
||
| 44 | } |
||
| 45 | } |
||
| 46 |