本文整理汇总了PHP中Illuminate\Support\Facades\App::runningUnitTests方法的典型用法代码示例。如果您正苦于以下问题:PHP App::runningUnitTests方法的具体用法?PHP App::runningUnitTests怎么用?PHP App::runningUnitTests使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\App
的用法示例。
在下文中一共展示了App::runningUnitTests方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInterfaceLocale
public function getInterfaceLocale()
{
$locale = Input::get("l");
$translating = Input::get("t");
$primary = Input::get("p");
$displayLocales = Input::get("d");
$display = implode(',', $displayLocales ?: []);
App::setLocale($locale);
Cookie::queue($this->cookieName(self::COOKIE_LANG_LOCALE), $locale, 60 * 24 * 365 * 1);
Cookie::queue($this->cookieName(self::COOKIE_TRANS_LOCALE), $translating, 60 * 24 * 365 * 1);
Cookie::queue($this->cookieName(self::COOKIE_PRIM_LOCALE), $primary, 60 * 24 * 365 * 1);
Cookie::queue($this->cookieName(self::COOKIE_DISP_LOCALES), $display, 60 * 24 * 365 * 1);
if (App::runningUnitTests()) {
return Redirect::to('/');
}
return !is_null(Request::header('referer')) ? Redirect::back() : Redirect::to('/');
}
示例2: resetDatabase
private function resetDatabase()
{
$env = App::environment();
$this->output->writeln("Truncating tables in {$env} environment");
if (App::isLocal()) {
foreach ($this->tables as $table) {
$this->output->writeln("Truncating {$table}");
DB::statement('TRUNCATE TABLE ' . $table . ' CASCADE;');
}
} elseif (App::runningUnitTests()) {
Eloquent::unguard();
foreach ($this->tables as $table) {
$this->output->writeln("Truncating {$table}");
DB::statement('TRUNCATE TABLE ' . $table . ' CASCADE;');
}
}
}