當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Config::setFacadeApplication方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\Config::setFacadeApplication方法的典型用法代碼示例。如果您正苦於以下問題:PHP Config::setFacadeApplication方法的具體用法?PHP Config::setFacadeApplication怎麽用?PHP Config::setFacadeApplication使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\Config的用法示例。


在下文中一共展示了Config::setFacadeApplication方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testRoles

 public function testRoles()
 {
     /*
     |------------------------------------------------------------
     | Set
     |------------------------------------------------------------
     */
     $belongsToMany = new stdClass();
     $user = m::mock('HasRoleUser')->makePartial();
     $app = m::mock('app')->shouldReceive('instance')->getMock();
     $config = m::mock('config');
     Config::setFacadeApplication($app);
     Config::swap($config);
     /*
     |------------------------------------------------------------
     | Expectation
     |------------------------------------------------------------
     */
     $user->shouldReceive('belongsToMany')->with('role_table_name', 'assigned_roles_table_name', 'user_id', 'role_id')->andReturn($belongsToMany)->once();
     Config::shouldReceive('get')->once()->with('entrust.role')->andReturn('role_table_name');
     Config::shouldReceive('get')->once()->with('entrust.role_user_table')->andReturn('assigned_roles_table_name');
     /*
     |------------------------------------------------------------
     | Assertion
     |------------------------------------------------------------
     */
     $this->assertSame($belongsToMany, $user->roles());
 }
開發者ID:ChenYx,項目名稱:test,代碼行數:28,代碼來源:EntrustUserTest.php

示例2: setUp

 /**
  * Set up the tests
  */
 public function setUp()
 {
     parent::setUp();
     // Bind Polyglot classes
     $provider = new PolyglotServiceProvider($this->app);
     $provider->register();
     $provider->boot();
     $this->app['translator'] = $this->app['polyglot.translator'];
     // Configure facades
     Config::setFacadeApplication($this->app);
 }
開發者ID:anahkiasen,項目名稱:polyglot,代碼行數:14,代碼來源:PolyglotTestCase.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     $app = m::mock('app')->shouldReceive('instance')->getMock();
     $this->facadeMocks['config'] = m::mock('config');
     $this->facadeMocks['cache'] = m::mock('cache');
     Config::setFacadeApplication($app);
     Config::swap($this->facadeMocks['config']);
     Cache::setFacadeApplication($app);
     Cache::swap($this->facadeMocks['cache']);
 }
開發者ID:19peaches,項目名稱:lumineer,代碼行數:11,代碼來源:LumineerUserTest.php


注:本文中的Illuminate\Support\Facades\Config::setFacadeApplication方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。