0

I have been trying to use the Hash functionality from the Laravel framework. I have a Laravel TestCase where I check to see if the value of string that is hashed is equal to the correct one. To be more exact I have something like this:

use Illuminate\Support\Facades\Hash;

class SimpleTestCase extends TestCase {

    public function testSimple() {
        $expected_hash_string = ...; //Some string derived from another source
        $hashed_string = Hash::make("my_string");
        $this->assertTrue($hashed_string == $expected_hash_string);
    }
}

(This is just a very simple example, so it is not runnable)

So here I get an error which says the following:

    Fatal error: Call to a member function make() on a non-object in .....

Is there some configuration setting that I am missing here?

Thanks

Farhan Rahman
  • 206
  • 2
  • 12
  • Can you show the full error message? How did you implemented `Hash::make()` ? – hek2mgl Aug 12 '14 at 10:48
  • This code *cannot* produce this error, since you're calling `make` statically here. – deceze Aug 12 '14 at 10:50
  • Hi Thanks for the reply. Here is the full error that points to Facade.php in Laravel. Fatal error: Call to a member function make() on a non-object in /Applications/MAMP/htdocs//vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 208 Hope that helps. Please let me know if you want more information.. – Farhan Rahman Aug 12 '14 at 10:59
  • Ah I fixed it. I had to call the following function from the TestCase provided by Laravel: $this->createApplication(); – Farhan Rahman Aug 12 '14 at 11:12

0 Answers0