Load ActionProvider in unit tests
This commit is contained in:
@@ -174,34 +174,6 @@ define('LDAP_GROUP_FILTER', '');
|
|||||||
define('LDAP_GROUP_ATTRIBUTE_NAME', 'cn');
|
define('LDAP_GROUP_ATTRIBUTE_NAME', 'cn');
|
||||||
```
|
```
|
||||||
|
|
||||||
Google Authentication settings
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
```php
|
|
||||||
// Enable/disable Google authentication
|
|
||||||
define('GOOGLE_AUTH', false);
|
|
||||||
|
|
||||||
// Google client id (Get this value from the Google developer console)
|
|
||||||
define('GOOGLE_CLIENT_ID', '');
|
|
||||||
|
|
||||||
// Google client secret key (Get this value from the Google developer console)
|
|
||||||
define('GOOGLE_CLIENT_SECRET', '');
|
|
||||||
```
|
|
||||||
|
|
||||||
Github Authentication settings
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
```php
|
|
||||||
// Enable/disable GitHub authentication
|
|
||||||
define('GITHUB_AUTH', false);
|
|
||||||
|
|
||||||
// GitHub client id (Copy it from your settings -> Applications -> Developer applications)
|
|
||||||
define('GITHUB_CLIENT_ID', '');
|
|
||||||
|
|
||||||
// GitHub client secret key (Copy it from your settings -> Applications -> Developer applications)
|
|
||||||
define('GITHUB_CLIENT_SECRET', '');
|
|
||||||
```
|
|
||||||
|
|
||||||
Reverse-Proxy Authentication settings
|
Reverse-Proxy Authentication settings
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -16,13 +16,14 @@ class AverageTimeSpentColumnAnalyticTest extends Base
|
|||||||
$taskCreationModel = new TaskCreation($this->container);
|
$taskCreationModel = new TaskCreation($this->container);
|
||||||
$projectModel = new Project($this->container);
|
$projectModel = new Project($this->container);
|
||||||
$averageLeadCycleTimeAnalytic = new AverageTimeSpentColumnAnalytic($this->container);
|
$averageLeadCycleTimeAnalytic = new AverageTimeSpentColumnAnalytic($this->container);
|
||||||
$now = time();
|
|
||||||
|
|
||||||
$this->assertEquals(1, $projectModel->create(array('name' => 'test1')));
|
$this->assertEquals(1, $projectModel->create(array('name' => 'test1')));
|
||||||
|
|
||||||
$this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test')));
|
$this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test')));
|
||||||
$this->assertEquals(2, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test')));
|
$this->assertEquals(2, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test')));
|
||||||
|
|
||||||
|
$now = time();
|
||||||
|
|
||||||
$this->container['db']->table(Task::TABLE)->eq('id', 1)->update(array('date_completed' => $now + 3600));
|
$this->container['db']->table(Task::TABLE)->eq('id', 1)->update(array('date_completed' => $now + 3600));
|
||||||
$this->container['db']->table(Task::TABLE)->eq('id', 2)->update(array('date_completed' => $now + 1800));
|
$this->container['db']->table(Task::TABLE)->eq('id', 2)->update(array('date_completed' => $now + 1800));
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use SimpleLogger\Logger;
|
|||||||
use SimpleLogger\File;
|
use SimpleLogger\File;
|
||||||
use Kanboard\Core\Session\FlashMessage;
|
use Kanboard\Core\Session\FlashMessage;
|
||||||
use Kanboard\Core\Session\SessionStorage;
|
use Kanboard\Core\Session\SessionStorage;
|
||||||
use Kanboard\Core\Action\ActionManager;
|
use Kanboard\ServiceProvider\ActionProvider;
|
||||||
|
|
||||||
class FakeHttpClient
|
class FakeHttpClient
|
||||||
{
|
{
|
||||||
@@ -105,9 +105,9 @@ abstract class Base extends PHPUnit_Framework_TestCase
|
|||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$this->container['sessionStorage'] = new SessionStorage;
|
$this->container['sessionStorage'] = new SessionStorage;
|
||||||
$this->container['actionManager'] = new ActionManager($this->container);
|
$this->container->register(new ActionProvider);
|
||||||
|
|
||||||
$this->container['flash'] = function($c) {
|
$this->container['flash'] = function ($c) {
|
||||||
return new FlashMessage($c);
|
return new FlashMessage($c);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user