当前位置: 首页>>代码示例>>PHP>>正文


PHP Session::start方法代码示例

本文整理汇总了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]);
 }
开发者ID:baopham,项目名称:gdrive-comments,代码行数:7,代码来源:GDriveIntegrationTest.php

示例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());
 }
开发者ID:sabahtalateh,项目名称:laracast,代码行数:10,代码来源:ExampleTest.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     \Birdmin\Product::where('name', 'Test Product')->delete();
     Session::start();
     $this->be(User::find(1));
 }
开发者ID:breachofmind,项目名称:birdmin,代码行数:7,代码来源:RESTTest.php

示例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');
 }
开发者ID:fxcosta,项目名称:example-tdd-in-laravel-5,代码行数:9,代码来源:ArticleControllerTest.php

示例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);
 }
开发者ID:billwaddyjr,项目名称:dashboard,代码行数:11,代码来源:BaseDashboardControllerTest.php

示例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');
     }
 }
开发者ID:swapster,项目名称:leti_eng,代码行数:12,代码来源:SessionAuthController.php

示例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();
 }
开发者ID:zc1415926,项目名称:laravel-governor-tests,代码行数:20,代码来源:TestCase.php

示例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);
 }
开发者ID:alientronics,项目名称:fleetany-web,代码行数:6,代码来源:VehicleModelTest.php

示例9: setUp

 public function setUp()
 {
     parent::setUp();
     Session::start();
     $this->be(User::find(1));
 }
开发者ID:alientronics,项目名称:fleetany-web,代码行数:6,代码来源:TireControllerTest.php

示例10: setUp

 public function setUp()
 {
     parent::setUp();
     Session::start();
 }
开发者ID:fxcosta,项目名称:example-tdd-in-laravel-5,代码行数:5,代码来源:AuthControllerTest.php


注:本文中的Illuminate\Support\Facades\Session::start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。