for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dynamic\FoxyStripe\Test;
use Dynamic\FoxyStripe\Security\PasswordEncryptor_BCrypt;
use SilverStripe\Dev\FunctionalTest;
class PasswordEncryptor_BCryptTest extends FunctionalTest
{
public function testGetCost()
$encryptor = new PasswordEncryptor_BCrypt();
$this->assertEquals(10, $encryptor::get_cost());
}
public function testSetCost()
$original = $encryptor::get_cost();
$original
$encryptor::set_cost(15);
$this->assertEquals(15, $encryptor::get_cost());
public function testEncrypt()
$hash = $encryptor->encrypt('Mu$kie$9');
$this->assertTrue(hash_equals('$2y$10$mLQR4g09Sy6nih4o6bQL6upWfGB3TAgrx9ddnaHjM7nY0Usl9EbLq', $hash));