Skip to content

Commit

Permalink
Merge pull request #27 from point-red/develop
Browse files Browse the repository at this point in the history
update multi tenant testing
  • Loading branch information
martiendt committed Jun 6, 2018
2 parents 6fd233d + 7d214f7 commit b142054
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .circleci/config.yml
Expand Up @@ -85,6 +85,10 @@ jobs:
name: Create SQLite Database
command: touch database/database.sqlite

- run:
name: Create SQLite Tenant Database
command: touch database/databaseTenant.sqlite

- run:
name: Migrate Laravel Database
command: php artisan migrate
Expand Down Expand Up @@ -113,4 +117,4 @@ jobs:

- run:
name: Sending code coverage
command: php vendor/bin/coveralls
command: php vendor/bin/php-coveralls
5 changes: 2 additions & 3 deletions .travis.yml
@@ -1,16 +1,15 @@
language: php

php:
- 7.1
- 7.1.3

before_script:
- cp .env.example .env
- composer self-update
- composer install --no-interaction
- mysql -e 'create database testing;'
- mysql -e 'create database testing_tenant;'
- php artisan key:generate
- php artisan migrate
- php artisan db:seed --class="DatabaseSeeder"

script:
- vendor/bin/phpunit
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase.php
Expand Up @@ -20,13 +20,13 @@ public function setUp()

Artisan::call('config:clear');

config()->set('database.connections.tenant.driver', 'sqlite');
config()->set('database.connections.tenant.database', 'database/databaseTenant.sqlite');
config()->set('database.connections.tenant.driver', env('DB_TENANT_DRIVER'));
config()->set('database.connections.tenant.database', env('DB_TENANT_DATABASE'));

$this->getConnection(DB::getDefaultConnection())->disconnect();

$this->artisan('tenant:setup-database', [
'tenant_subdomain' => 'database/databaseTenant.sqlite',
'tenant_subdomain' => env('DB_TENANT_DATABASE'),
]);

$this->headers = [
Expand Down

0 comments on commit b142054

Please sign in to comment.