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