Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added config for tests with token
  • Loading branch information
hiqsol committed Jan 25, 2017
1 parent 6aa61f2 commit 4a53247
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
6 changes: 5 additions & 1 deletion composer.json
Expand Up @@ -59,7 +59,11 @@
"config-plugin": {
"params": "src/config/params.php",
"hisite": "src/config/common.php",
"hidev": "src/config/common.php"
"hidev": "src/config/common.php",
"tests": [
"src/config/common.php",
"src/config/tests.php"
]
}
},
"repositories": [
Expand Down
3 changes: 2 additions & 1 deletion src/config/common.php
Expand Up @@ -12,8 +12,9 @@
'components' => [
$params['github.dbname'] => array_filter([
'class' => \hiqdev\hiart\github\Connection::class,
'name' => $params['github.dbname'],
'requestClass' => $params['github.requestClass'] ?: $params['hiart.requestClass'],
'name' => $params['github.dbname'],
'auth' => $params['github.auth'],
]),
],
'container' => [
Expand Down
3 changes: 2 additions & 1 deletion src/config/params.php
Expand Up @@ -10,6 +10,7 @@

return [
'github.enabled' => true,
'github.dbname' => 'github',
'github.requestClass' => null, /// hiart.requestClass will be used
'github.dbname' => 'github',
'github.auth' => [],
];
21 changes: 21 additions & 0 deletions src/config/tests.php
@@ -0,0 +1,21 @@
<?php
/**
* GitHub API implementation for yii2-hiart
*
* @link https://github.com/hiqdev/yii2-hiart-github
* @package yii2-hiart-github
* @license BSD-3-Clause
* @copyright Copyright (c) 2017, HiQDev (http://hiqdev.com/)
*/

return array_filter([
'id' => 'yii2-hiart-github-tests',
'basePath' => dirname(__DIR__),
'components' => empty($params['github.enabled']) ? [] : [
$params['github.dbname'] => [
'auth' => [
'headerToken' => '46c92a877da26ae56ed4a062d5baf1fd66a4e066',
],
],
],
]);
5 changes: 1 addition & 4 deletions tests/_bootstrap.php
Expand Up @@ -16,7 +16,4 @@
use hiqdev\composer\config\Builder;
use yii\console\Application;

Yii::$app = new Application(array_merge([
'id' => 'hiart-github',
'basePath' => __DIR__,
], require Builder::path('hidev')));
Yii::$app = new Application(require Builder::path('tests'));

0 comments on commit 4a53247

Please sign in to comment.