本文整理汇总了PHP中Illuminate\Support\Facades\Session::start方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::start方法的具体用法?PHP Session::start怎么用?PHP Session::start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Session
的用法示例。
在下文中一共展示了Session::start方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_it_can_delete_a_saved_file
public function test_it_can_delete_a_saved_file()
{
Session::start();
$this->login();
$this->seedSavedFiles();
$this->delete('gdrive/files/' . static::SEED_FILE_ID, ['_token' => csrf_token()])->notSeeInDatabase('gdrive_files', ['id' => static::SEED_FILE_ID]);
}
示例2:
/**
* @test
*/
function it_hashes_a_password()
{
Session::start();
\Illuminate\Support\Facades\Hash::shouldReceive('make')->once()->andReturn('foobar_hashed_password');
$response = $this->action('POST', 'HashingController@postIndex', ['password' => 'foobar_password', '_token' => csrf_token()]);
$this->assertEquals('Your hash is foobar_hashed_password', $response->getContent());
}
示例3: setUp
public function setUp()
{
parent::setUp();
\Birdmin\Product::where('name', 'Test Product')->delete();
Session::start();
$this->be(User::find(1));
}
示例4: testCreateArticleSuccess
public function testCreateArticleSuccess()
{
$this->userLoggedIn();
$this->repositoryMock->shouldReceive('create')->once();
Session::start();
// Start a session for the current test
$this->call('POST', 'articles', ['title' => 'subject 999', 'body' => 'body 999', '_token' => csrf_token()]);
$this->assertRedirectedToRoute('articles.index');
}
示例5: setupData
protected function setupData()
{
// Added Session Start to properly test CSRF Token
Session::start();
$roleData = ['name' => 'Registered', 'slug' => 'registered'];
$roleData2 = ['name' => 'Administrator', 'slug' => 'administrator', 'permissions' => ['admin' => "1"]];
$userData = ['email' => 'admin@change.me', 'password' => 'test', 'password_confirmation' => 'test'];
$this->role->create($roleData);
$this->adminRole = $this->role->create($roleData2);
$this->auth->registerAndActivate($userData, false);
}
示例6: auth
public function auth()
{
$this->checkCookie();
if (Session::get('has_access')) {
return redirect('/profile');
} else {
if (!Session::has('error')) {
Session::start();
}
return response()->view('auth_form');
}
}
示例7: prepare
public function prepare()
{
Session::start();
$this->artisan('migrate', ['--path' => 'packages/genealabs/laravel-governor/database/migrations']);
$this->artisan('migrate', ['--path' => 'database/secondaryMigrations']);
$this->superAdminUser = factory(LaravelGovernorTests\User::class)->create();
$this->artisan('db:seed', ['--class' => 'LaravelGovernorDatabaseSeeder']);
$this->unauthorizedUser = factory(LaravelGovernorTests\User::class)->create();
$this->superAdminUser->fill(['name' => 'Test User', 'first_name' => 'Test', 'last_name' => 'User', 'email' => 'testuser@noemail.com', 'password' => 'test123$']);
$this->superAdminUser->save();
$this->rolePolicy = new RolePolicy();
$this->entityPolicy = new EntityPolicy();
$this->assignmentPolicy = new AssignmentPolicy();
$this->superAdminRole = Role::find('SuperAdmin');
$this->memberRole = Role::find('Member');
$this->role = new Role();
$this->entity = new Entity();
$this->assignment = new Assignment();
$this->memberUser = User::limit(2)->get()->last();
}
示例8: testLocalizationData
public function testLocalizationData()
{
Session::start();
$this->be(User::find(1));
$this->post('/vehicle/dashboard/localization', ['vehicle_id' => 1, "_token" => csrf_token()])->assertResponseStatus(200);
}
示例9: setUp
public function setUp()
{
parent::setUp();
Session::start();
$this->be(User::find(1));
}
示例10: setUp
public function setUp()
{
parent::setUp();
Session::start();
}