本文整理汇总了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());
}
示例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);
}
示例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']);
}