Created
April 22, 2014 17:08
-
-
Save kgust/11187011 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/phpunit/phpunit/src/Framework/Assert/Functions.php'; | |
class ExampleTest exends TestCase | |
{ | |
/** @test */ | |
function it_hashes_a_provided_password() | |
{ | |
Hash::shouldReceive('make')->once()->andReturn('foobar_hashed_password'); | |
$response = $this->action('POST', 'HashingController@postIndex', ['password' => 'foobar_password']); | |
// NOTE: Because of the require above, you can use asserts like functions. | |
assertEquals('Your hashed password is foobar_hashed_password.', $response->getContent()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment