diff options
author | i00171 <anton.delitsch@implema.se> | 2016-06-26 18:35:25 +0200 |
---|---|---|
committer | i00171 <anton.delitsch@implema.se> | 2016-06-26 18:35:25 +0200 |
commit | 47039d32c84ba699867920d2c3cb47a34b199b9d (patch) | |
tree | 4fbc2ec34889baeab00085e0509055dca7daee6a /tests/integration/Base.php | |
parent | 911be6ed00c1ece5d9ef2c16e80899bb7bffad67 (diff) | |
parent | c110dffefe259c13e60193fb81ebb9d4b79504de (diff) |
Merge branch 'master' of https://github.com/fguillot/kanboard
Diffstat (limited to 'tests/integration/Base.php')
-rw-r--r-- | tests/integration/Base.php | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/tests/integration/Base.php b/tests/integration/Base.php deleted file mode 100644 index 6f3ae076..00000000 --- a/tests/integration/Base.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -require_once __DIR__.'/../../vendor/autoload.php'; - -abstract class Base extends PHPUnit_Framework_TestCase -{ - protected $app = null; - protected $admin = null; - protected $user = null; - - public static function setUpBeforeClass() - { - if (DB_DRIVER === 'sqlite') { - @unlink(DB_FILENAME); - } elseif (DB_DRIVER === 'mysql') { - $pdo = new PDO('mysql:host='.DB_HOSTNAME, DB_USERNAME, DB_PASSWORD); - $pdo->exec('DROP DATABASE '.DB_NAME); - $pdo->exec('CREATE DATABASE '.DB_NAME); - $pdo = null; - } elseif (DB_DRIVER === 'postgres') { - $pdo = new PDO('pgsql:host='.DB_HOSTNAME, DB_USERNAME, DB_PASSWORD); - $pdo->exec('DROP DATABASE '.DB_NAME); - $pdo->exec('CREATE DATABASE '.DB_NAME.' WITH OWNER '.DB_USERNAME); - $pdo = null; - } - - $service = new Kanboard\ServiceProvider\DatabaseProvider; - - $db = $service->getInstance(); - $db->table('settings')->eq('option', 'api_token')->update(array('value' => API_KEY)); - $db->closeConnection(); - } - - public function setUp() - { - $this->app = new JsonRPC\Client(API_URL); - $this->app->authentication('jsonrpc', API_KEY); - $this->app->getHttpClient()->withDebug(); - - $this->admin = new JsonRPC\Client(API_URL); - $this->admin->authentication('admin', 'admin'); - $this->admin->getHttpClient()->withDebug(); - - $this->user = new JsonRPC\Client(API_URL); - $this->user->authentication('user', 'password'); - $this->user->getHttpClient()->withDebug(); - } - - protected function getProjectId() - { - $projects = $this->app->getAllProjects(); - $this->assertNotEmpty($projects); - return $projects[0]['id']; - } - - protected function getGroupId() - { - $groups = $this->app->getAllGroups(); - $this->assertNotEmpty($groups); - return $groups[0]['id']; - } -} |