在非对象上调用成员函数make()

时间:2014-08-12 10:45:12

标签: php laravel phpunit

我一直在尝试使用Laravel框架中的Hash功能。我有一个Laravel TestCase,我在其中检查散列的字符串的值是否等于正确的值。更确切地说,我有类似的东西:

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);
    }
}

(这只是一个非常简单的例子,因此它不可运行)

所以我在这里得到一个错误,说明如下:

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

我在这里缺少一些配置设置吗?

由于

0 个答案:

没有答案