for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Firesphere\YubiAuth\Tests;
use Firesphere\YubiAuth\Forms\YubikeyForm;
use SilverStripe\Control\Controller;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Dev\SapphireTest;
class YubikeyFormTest extends SapphireTest
{
public function testBackURL()
$backURL = '/test/url';
$request = new HTTPRequest('GET', '/', ['BackURL' => $backURL]);
$controller = Controller::curr();
$controller->setRequest($request);
$form = YubikeyForm::create($controller);
$fields = $form->getFormFields();
$this->assertNotNull($fields->dataFieldByName('BackURL'));
}
public function testAuthenticatorName()
$form = YubikeyForm::create();
$this->assertEquals('Yubikey authentication', $form->getAuthenticatorName());