for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace UserManagement\Tests;
use SilverStripe\Dev\FunctionalTest;
use UserManagement\Page\LostPasswordPage;
/**
* Class LostPasswordPageTest
*
* @package user-management
*/
class LostPasswordPageTest extends FunctionalTest
{
* Lost password page link test
public function testfindlink()
$page = $this->get("forgotten-password/"); // attempt to access the Lost Forgot Page
$this->assertEquals(200, $page->getStatusCode(), "a page should load");
$this->assertEquals(
LostPasswordPage::find_link(false),
"/forgotten-password/",
"LostPasswordPage exists"
);
}
* Lost password form test
public function testLostPasswordForm()
$this->get("forgotten-password/");
$this->submitForm(
"LostPasswordForm_lostPasswordForm",
"action_forgotPassword",
array("Email" => "[email protected]")
false,
http_response_code(),
'testLostPasswordForm() sends email'
* Can create
public function testCanCreate()
$canCreate = LostPasswordPage::create()->canCreate();
$this->assertNotTrue($canCreate, "Can create");