本文整理汇总了PHP中Illuminate\Support\Facades\App::clearResolvedInstances方法的典型用法代码示例。如果您正苦于以下问题:PHP App::clearResolvedInstances方法的具体用法?PHP App::clearResolvedInstances怎么用?PHP App::clearResolvedInstances使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\App
的用法示例。
在下文中一共展示了App::clearResolvedInstances方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: it_should_bind_index
/**
* @test
*/
public function it_should_bind_index()
{
/**
* Set
*/
App::clearResolvedInstances();
App::shouldReceive('make')->with('menthol.flexible.index', m::any())->once()->andReturn('mock');
App::shouldReceive('make')->with('Elasticsearch')->twice()->andReturn('mock');
$config = m::mock('Menthol\\Flexible\\Config');
App::shouldReceive('make')->with('Menthol\\Flexible\\Config')->once()->andReturn($config);
$config->shouldReceive('get')->with('elasticsearch.index_prefix', '')->andReturn('');
$model = m::mock('Illuminate\\Database\\Eloquent\\Model');
$model->shouldReceive('getTable')->once()->andReturn('mockType');
$app = m::mock('LaravelApp');
$proxy = m::mock('Menthol\\Flexible\\Proxy', [$model]);
$sp = m::mock('Menthol\\Flexible\\FlexibleServiceProvider[bindIndex]', [$app]);
/**
* Expectation
*/
$app->shouldReceive('bind')->once()->andReturnUsing(function ($name, $closure) use($app, $proxy) {
$this->assertEquals('menthol.flexible.index', $name);
$this->assertInstanceOf('Menthol\\Flexible\\Index', $closure($app, ['proxy' => $proxy, 'name' => 'name']));
});
/**
* Assertion
*/
$sp->bindIndex();
}
示例2: tearDown
public function tearDown()
{
App::clearResolvedInstances();
parent::tearDown();
}
示例3: destroy
/**
* Force destroy the container
*
* WARNING: Avoid using this, unless you really need to
* destroy the IoC!
*/
public function destroy()
{
$this->container = null;
App::clearResolvedInstances();
App::setFacadeApplication(null);
self::$instance = null;
}
示例4: destroy
/**
* Destroy the Inversion of Control (IoC) Container
*/
public static function destroy()
{
App::clearResolvedInstances();
App::setFacadeApplication(null);
self::setContainer(null);
}