當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。