本文整理汇总了PHP中Illuminate\Support\Facades\Facade::clearResolvedInstances方法的典型用法代码示例。如果您正苦于以下问题:PHP Facade::clearResolvedInstances方法的具体用法?PHP Facade::clearResolvedInstances怎么用?PHP Facade::clearResolvedInstances使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Facade
的用法示例。
在下文中一共展示了Facade::clearResolvedInstances方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reboot
/**
* After each scenario, reboot the kernel.
*/
public function reboot()
{
Facade::clearResolvedInstances();
$lumen = new LumenBooter($this->app->basePath());
$this->context->getSession('lumen')->getDriver()->reboot($this->app = $lumen->boot());
$this->setAppOnContext();
}
示例2: it_should_get_a_proxy
/**
* @test
*/
public function it_should_get_a_proxy()
{
/**
*
* Set
*
*/
$proxy = m::mock('Iverberk\\Larasearch\\proxy');
/**
*
* Expectation
*
*/
Facade::clearResolvedInstances();
\Husband::clearProxy();
App::shouldReceive('make')->with('iverberk.larasearch.proxy', m::type('Illuminate\\Database\\Eloquent\\Model'))->andReturn($proxy);
/**
*
*
* Assertion
*
*/
$proxy1 = \Husband::getProxy();
$this->assertSame($proxy, $proxy1);
$proxy2 = \Husband::getProxy();
$this->assertSame($proxy, $proxy2);
}
示例3: bootstrap
public function bootstrap(Application $app, $config)
{
\Illuminate\Support\Facades\Facade::clearResolvedInstances();
\Illuminate\Support\Facades\Facade::setFacadeApplication($app);
#注册别名并设置自动加载器
\Illuminate\Foundation\AliasLoader::getInstance($config['app_aliases'])->register();
}
示例4: stopApplication
/**
* Stop the application
*
* @return void
*/
public function stopApplication()
{
if ($this->hasApplicationBeenStarted()) {
foreach ($this->beforeApplicationDestroyedCallbacks as $callback) {
call_user_func($callback);
}
$this->app->flush();
$this->app = null;
Facade::clearResolvedInstances();
Facade::setFacadeApplication(null);
}
}
示例5: setUp
/**
* Setup the test environment.
*
* @return void
*/
protected function setUp()
{
if (!$this->app) {
$this->refreshApplication();
}
$this->setUpTraits();
foreach ($this->afterApplicationCreatedCallbacks as $callback) {
call_user_func($callback);
}
Facade::clearResolvedInstances();
Model::setEventDispatcher($this->app['events']);
$this->setUpHasRun = true;
}
示例6: setUp
protected function setUp()
{
parent::setUp();
self::$functions = m::mock();
$this->index = m::mock('Menthol\\Flexible\\Index');
$this->model = m::mock('Husband')->makePartial();
$this->client = m::mock('Elasticsearch\\Client');
$this->model->shouldReceive('getTable')->once()->andReturn('Husbands');
Facade::clearResolvedInstances();
App::shouldReceive('make')->with('Elasticsearch')->once()->andReturn($this->client);
App::shouldReceive('make')->with('menthol.flexible.index', m::type('array'))->once()->andReturn($this->index);
$this->proxy = new Proxy($this->model);
self::$functions->shouldReceive('date')->andReturn('9999');
}
示例7: createApplication
/**
* Creates the application.
*
* Needs to be implemented by subclasses.
*
* @return \Symfony\Component\HttpKernel\HttpKernelInterface
*/
public function createApplication()
{
$app = new Application();
$app->detectEnvironment(array('local' => array('your-machine-name')));
$app->bindInstallPaths($this->getApplicationPaths());
$app['env'] = 'testing';
$app->instance('app', $app);
Facade::clearResolvedInstances();
Facade::setFacadeApplication($app);
$app->registerCoreContainerAliases();
with($envVariables = new EnvironmentVariables($app->getEnvironmentVariablesLoader()))->load($app['env']);
$app->instance('config', $config = new Repository($app->getConfigLoader(), $app['env']));
$app->startExceptionHandling();
date_default_timezone_set($this->getApplicationTimezone());
$aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases());
AliasLoader::getInstance($aliases)->register();
Request::enableHttpMethodParameterOverride();
$providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders());
$app->getProviderRepository()->load($app, $providers);
$this->registerBootedCallback($app);
return $app;
}
示例8: getMocks
/**
* Construct an Index mock
*
* @return array
*/
private function getMocks($index_prefix = '')
{
/**
*
* Expectation
*
*/
Facade::clearResolvedInstances();
$client = m::mock('Elasticsearch\\Client');
$config = m::mock('Menthol\\Flexible\\Config');
App::shouldReceive('make')->with('Elasticsearch')->andReturn($client);
App::shouldReceive('make')->with('Menthol\\Flexible\\Config')->andReturn($config);
$config->shouldReceive('get')->with('elasticsearch.index_prefix', '')->andReturn($index_prefix);
$proxy = m::mock('Menthol\\Flexible\\Proxy');
$proxy->shouldReceive('getModel->getTable')->andReturn('Husband');
$index = m::mock('Menthol\\Flexible\\Index', [$proxy], [m::BLOCKS => ['setName', 'setProxy']])->makePartial();
return [$index, $proxy, $client, $config];
}
示例9: restoreAfterRequest
public function restoreAfterRequest()
{
$this->make('config')->set($this->needBackupConfigs);
// clear all, not just request
Facade::clearResolvedInstances();
foreach ($this->needBackUpAppAttributes as $attri) {
// echo "\n $attri\n";
//if(is_array($this->$attri))
//echo count($this->__oldValues[$attri]) - count($this->$attri);
$this->{$attri} = $this->__oldValues[$attri];
}
foreach ($this->restoreTool as $tool) {
$tool();
}
$this->bootedInRequest = false;
}
示例10: it_shoud_reindex_on_model_delete
/**
*
*/
public function it_shoud_reindex_on_model_delete()
{
/**
*
* Expectation
*
*/
Facade::clearResolvedInstances();
Queue::shouldReceive('push')->with('Iverberk\\Larasearch\\Jobs\\DeleteJob', ['Husband:2'])->once();
Queue::shouldReceive('push')->with('Iverberk\\Larasearch\\Jobs\\ReindexJob', ['Wife:2', 'Child:2', 'Toy:2'])->once();
Config::shouldReceive('get')->with('/^larasearch::reversedPaths\\..*$/', array())->once()->andReturn(['', 'wife', 'children', 'children.toys']);
$husband = \Husband::find(2);
with(new Observer())->deleted($husband);
}
示例11: registerBaseFacades
protected function registerBaseFacades()
{
Facade::clearResolvedInstances();
Facade::setFacadeApplication($this);
class_alias('Illuminate\\Support\\Facades\\App', 'App');
class_alias('Illuminate\\Support\\Facades\\Schema', 'Schema');
class_alias('Illuminate\\Support\\Facades\\Event', 'Event');
class_alias('Illuminate\\Support\\Facades\\DB', 'DB');
class_alias('Illuminate\\Database\\Eloquent\\Model', 'Eloquent');
class_alias('Illuminate\\Support\\Facades\\File', 'File');
class_alias('Illuminate\\Support\\Facades\\Config', 'Config');
class_alias('Illuminate\\Support\\Facades\\Blade', 'Blade');
class_alias('Illuminate\\Support\\Facades\\View', 'View');
}
示例12: resolveApplicationCore
/**
* Resolve application core implementation.
*
* @param \Illuminate\Foundation\Application $app
*
* @return void
*/
protected function resolveApplicationCore($app)
{
Facade::clearResolvedInstances();
Facade::setFacadeApplication($app);
$app->detectEnvironment(function () {
return 'testing';
});
}
示例13: _afterStep
/**
* After step hook.
*
* @param \Codeception\Step $step
*/
public function _afterStep(\Codeception\Step $step)
{
\Illuminate\Support\Facades\Facade::clearResolvedInstances();
parent::_afterStep($step);
}
示例14: _afterStep
/**
* After step hook.
*
* @param \Codeception\Step $step
*/
public function _afterStep(Step $step)
{
Facade::clearResolvedInstances();
}
示例15: boot
/**
* Boot Cubex, Setup Facades, & Service Providers
*/
public function boot()
{
if ($this->_booted) {
return null;
}
//Fix anything that hasnt been set by the projects bootstrap
$this->prepareCubex();
//Bind services
$this->processConfiguration($this->getConfiguration());
//Setup facades
Facade::clearResolvedInstances();
Facade::setFacadeApplication($this);
FacadeLoader::register();
//Setup Service Providers
$serviceManager = new ServiceManager();
$serviceManager->setCubex($this);
$serviceManager->boot();
$this->instance('service.manager', $serviceManager);
$this->_booted = true;
}