for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace UserManagement\Tests;
use UserManagement\Forms\SignUpForm;
use SilverStripe\Dev\FunctionalTest;
use SilverStripe\Security\Member;
/**
* Class SignUpFormTest
*
* @package user-management
*/
class SignUpFormTest extends FunctionalTest
{
* Signup form test
public function testMyForm()
$this->get("user-registration/");
$this->submitForm("SignUpForm", "action_doSubmit", array("FirstName" => "John",
"Password[_Password]" => "admin",
"Password[_ConfirmPassword]" => "admin", "Email" => "[email protected]"));
$this->assertEquals(
1,
Member::get()->filter("Email", "[email protected]")->count() > 0 ? 1 : 0,
'testMyForm() returns the user email'
);
}