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


PHP Route::enableFilters方法代码示例

本文整理汇总了PHP中Route::enableFilters方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::enableFilters方法的具体用法?PHP Route::enableFilters怎么用?PHP Route::enableFilters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Route的用法示例。


在下文中一共展示了Route::enableFilters方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testTodosRoutes

 /**
  * TodosControllerのテスト
  *
  * @return void
  */
 public function testTodosRoutes()
 {
     // フィルタを有効にする
     Route::enableFilters();
     // GET /todos
     $response = $this->call('GET', '/todos');
     $this->assertEquals(200, $response->getStatusCode());
     // POST /todos
     $input = ['_token' => Session::token()];
     $response = $this->call('POST', '/todos', $input);
     $this->assertEquals(302, $response->getStatusCode());
     $this->assertHasOldInput();
     // POST /todos/1/update
     $input = ['_token' => Session::token()];
     $response = $this->call('POST', '/todos/1/update', $input);
     $this->assertEquals(404, $response->getStatusCode());
     // PUT /todos/1/title
     $input = [];
     $response = $this->call('PUT', '/todos/1/title', $input);
     $this->assertEquals(404, $response->getStatusCode());
     // POST /todos/1/delete
     $input = ['_token' => Session::token()];
     $response = $this->call('POST', '/todos/1/delete', $input);
     $this->assertEquals(404, $response->getStatusCode());
     // POST /todos/1/restore
     $input = ['_token' => Session::token()];
     $response = $this->call('POST', '/todos/1/restore', $input);
     $this->assertEquals(404, $response->getStatusCode());
 }
开发者ID:r-itakura,项目名称:l4-sample-todo,代码行数:34,代码来源:RouteTest.php

示例2: initTestStep

 /**
  * Initializes the test step by enabling filters
  *
  * @param  bool  $enableFilters
  * @return void
  */
 protected function initTestStep($enableFilters = TRUE)
 {
     $this->be(User::first());
     if ($enableFilters) {
         Route::enableFilters();
     }
 }
开发者ID:moises-silva,项目名称:sticky-notes,代码行数:13,代码来源:StickyNotesTestCase.php

示例3: setUp

 /**
  * setUp
  */
 public function setUp()
 {
     parent::setUp();
     Artisan::call('migrate');
     $this->seed(__CLASS__ . 'Seeder');
     Route::enableFilters();
 }
开发者ID:yoshiyukiohta,项目名称:gihyo-laravel-book-reservation,代码行数:10,代码来源:ApiReservationTest.php

示例4: testFailToLoadDashboardBeforeLoggingIn

 public function testFailToLoadDashboardBeforeLoggingIn(TestGuy $I)
 {
     Route::enableFilters();
     $I->am('a user');
     $I->amOnPage('day004_dashboard');
     $I->seeInCurrentUrl('day004_login');
 }
开发者ID:viniciusferreira,项目名称:daily,代码行数:7,代码来源:Day004_LoginCest.php

示例5: prepareForTests

 /**
  * Prepare for the tests to be run.
  */
 public function prepareForTests()
 {
     // Enable your route filters, very important!
     \Route::enableFilters();
     \Route::any('{all}', 'Tdt\\Core\\BaseController@handleRequest')->where('all', '.*');
     \Mail::pretend(true);
 }
开发者ID:jalbertbowden,项目名称:core,代码行数:10,代码来源:TestCase.php

示例6: prepareForTests

 protected function prepareForTests()
 {
     parent::prepareForTests();
     Route::enableFilters();
     $this->current_realm = Config::get('app.url');
     $user = User::where('identifier', '=', 'sebastian.marcet')->first();
     $this->be($user);
     Session::start();
     $scope = $this->getScopes();
     $this->client_id = 'Jiz87D8/Vcvr6fvQbH4HyNgwTlfSyQ3x.openstack.client';
     $this->client_secret = 'ITc/6Y5N7kOtGKhg';
     $params = array('client_id' => $this->client_id, 'redirect_uri' => 'https://www.test.com/oauth2', 'response_type' => OAuth2Protocol::OAuth2Protocol_ResponseType_Code, 'scope' => implode(' ', $scope), OAuth2Protocol::OAuth2Protocol_AccessType => OAuth2Protocol::OAuth2Protocol_AccessType_Offline);
     Session::set("openid.authorization.response", IAuthService::AuthorizationResponse_AllowOnce);
     $response = $this->action("POST", "OAuth2ProviderController@authorize", $params, array(), array(), array());
     $status = $response->getStatusCode();
     $url = $response->getTargetUrl();
     $content = $response->getContent();
     $comps = @parse_url($url);
     $query = $comps['query'];
     $output = array();
     parse_str($query, $output);
     $params = array('code' => $output['code'], 'redirect_uri' => 'https://www.test.com/oauth2', 'grant_type' => OAuth2Protocol::OAuth2Protocol_GrantType_AuthCode);
     $response = $this->action("POST", "OAuth2ProviderController@token", $params, array(), array(), array("HTTP_Authorization" => " Basic " . base64_encode($this->client_id . ':' . $this->client_secret)));
     $status = $response->getStatusCode();
     $this->assertResponseStatus(200);
     $content = $response->getContent();
     $response = json_decode($content);
     $access_token = $response->access_token;
     $refresh_token = $response->refresh_token;
     $this->access_token = $access_token;
 }
开发者ID:smarcet,项目名称:openstackid,代码行数:31,代码来源:OAuth2ProtectedApiTest.php

示例7: setUp

 public function setUp()
 {
     parent::setUp();
     Route::enableFilters();
     $user = User::find(1);
     $this->be($user);
 }
开发者ID:NorthPL,项目名称:Solder-for-NorthLauncher,代码行数:7,代码来源:BuildTest.php

示例8: testLoginRouteRedirectsWhenLoggedIn

 public function testLoginRouteRedirectsWhenLoggedIn()
 {
     Route::enableFilters();
     $user = $this->factory->create('user');
     Sentry::login($user);
     $this->client->request('GET', URL::action('AuthController@getLogin'));
     $this->assertRedirectedTo('/');
 }
开发者ID:thomaswelton,项目名称:laravel,代码行数:8,代码来源:AuthControllerTest.php

示例9: setUp

 /**
  * Set session and enable Laravel filters
  *
  */
 public function setUp()
 {
     parent::setUp();
     // Enable session
     Session::start();
     // Enable filters
     Route::enableFilters();
 }
开发者ID:LiveZenLK,项目名称:Laravel-4-Bootstrap-Starter-Site,代码行数:12,代码来源:BaseControllerTestCase.php

示例10: setup

 public function setup()
 {
     parent::setUp();
     Session::start();
     //enable filters as filters are disabled by default
     Route::enableFilters();
     $this->prepareForTests();
 }
开发者ID:shankargiri,项目名称:Quantum-Vic-La-Trobe-L4,代码行数:8,代码来源:TestCase.php

示例11: request

 protected function request($method = 'GET', $uri = '', $params = [], $server = [], $content = null)
 {
     $files = [];
     $changeHistory = true;
     \Route::enableFilters();
     // http://laravel.com/api/4.2/Illuminate/Foundation/Testing/TestCase.html#method_call
     return $this->call($method, $uri, $params, $files, $server, $content, $changeHistory);
 }
开发者ID:scmc,项目名称:learninglocker,代码行数:8,代码来源:RouteTestTrait.php

示例12: createApplication

 /**
  * Creates the application.
  *
  * @return \Symfony\Component\HttpKernel\HttpKernelInterface
  */
 public function createApplication()
 {
     $unitTesting = true;
     $testEnvironment = 'testing';
     return require __DIR__ . '/../../bootstrap/start.php';
     Session::start();
     Route::enableFilters();
 }
开发者ID:shampine,项目名称:plumage,代码行数:13,代码来源:TestCase.php

示例13: testCreateBillFailBillIdIsset

 /**
  *
  * @return void
  */
 public function testCreateBillFailBillIdIsset()
 {
     Route::enableFilters();
     $this->call('PUT', Config::get('ff-qiwi-gate::app.url') . '/qiwi/gate/api/v2/prv/1/bills/4a5s6d', array('user' => 'tel:+79161234567', 'amount' => '123.34', 'ccy' => 'RUB', 'comment' => 'Test!'), array(), array('HTTP_Authorization' => 'Basic ' . base64_encode('1:password')));
     $oResponse = $this->response()->getData();
     $this->assertEquals(215, $oResponse->response->result_code);
     $this->assertEquals(403, $this->client->getResponse()->getStatusCode());
 }
开发者ID:fintech-fab,项目名称:qiwi-gate,代码行数:12,代码来源:QiwiCreateBillTest.php

示例14: setUp

 public function setUp()
 {
     parent::setUp();
     Route::enableFilters();
     // Authentication as super user.
     $user = User::firstOrCreate(['email' => 'quan@ll.com']);
     Auth::login($user);
 }
开发者ID:jesposito,项目名称:learninglocker,代码行数:8,代码来源:StatementPutTest.php

示例15: testTracking

 public function testTracking()
 {
     Route::enableFilters();
     $request = Request::instance();
     $ab = Mockery::mock('Jamesblackwell\\AB\\Tester');
     $ab->shouldReceive('track')->with($request)->once();
     $this->app['ab'] = $ab;
     $this->app->events->fire('router.before', [$request]);
 }
开发者ID:jamesblackwell,项目名称:laravel-experiments,代码行数:9,代码来源:GeneralTest.php


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