本文整理匯總了PHP中Orchestra\Testbench\TestCase::setup方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestCase::setup方法的具體用法?PHP TestCase::setup怎麽用?PHP TestCase::setup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Orchestra\Testbench\TestCase
的用法示例。
在下文中一共展示了TestCase::setup方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setup
/**
* Setup the test environment.
*
* @return array
*/
public function setup()
{
parent::setup();
if (getenv("TRAVIS")) {
$appName = getenv("KINVEY_APP_NAME");
$appKey = getenv("KINVEY_APP_KEY");
$appSecret = getenv("KINVEY_APP_SECRET");
$masterSecret = getenv("KINVEY_MASTER_SECRET");
$testMail = getenv("TEST_MAIL");
} else {
extract(include __DIR__ . '/TestConfig.php');
}
// Kinvey client configuration.
$this->app['config']->set('kinvey::appName', $appName);
$this->app['config']->set('kinvey::appKey', $appKey);
$this->app['config']->set('kinvey::appSecret', $appSecret);
$this->app['config']->set('kinvey::masterSecret', $masterSecret);
// Test mail account.
$this->app['config']->set('kinvey::testMail', $testMail);
// Eloquent user model.
$authConfig = $this->app['config']['auth'];
$authConfig['model'] = 'GovTribe\\LaravelKinvey\\Database\\Eloquent\\User';
$this->app['config']->set('auth', $authConfig);
// Default database
$this->app['config']->set('database.connections.kinvey', array('driver' => 'kinvey'));
$this->app['config']->set('database.default', 'kinvey');
// Set the auth mode to admin.
Kinvey::setAuthMode('admin');
}