added tests to develop branch.

This commit is contained in:
Taylor Otwell
2012-03-27 15:41:30 -05:00
parent f4258f7759
commit 15fe1d5258
80 changed files with 6510 additions and 0 deletions

37
tests/cases/hash.test.php Normal file
View File

@@ -0,0 +1,37 @@
<?php
class HashTest extends PHPUnit_Framework_TestCase {
/**
* Test the Hash::make method.
*
* @group laravel
*/
public function testHashProducesValidBcryptHash()
{
$this->assertTrue(strlen(Hash::make('taylor')) == 60);
}
/**
* Test the Hash::check method.
*
* @group laravel
*/
public function testHashCheckFailsWhenNotMatching()
{
$hash = Hash::make('taylor');
$this->assertFalse(Hash::check('foo', $hash));
}
/**
* Test the Hash::check method.
*
* @group laravel
*/
public function testHashCheckPassesWhenMatches()
{
$this->assertTrue(Hash::check('taylor', Hash::make('taylor')));
}
}