Skip to content

Commit

Permalink
[1.7.0] Fix Events system (archtechx#94)
Browse files Browse the repository at this point in the history
* Add TenantManagerEvents

* Apply fixes from StyleCI

* Fix typos, add tests

* end() events

* Travis should be failing

* Uncomment ending
  • Loading branch information
stancl authored Aug 14, 2019
1 parent c1df467 commit 1a88cad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/Traits/BootstrapsTenancy.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public function bootstrap()

public function end()
{
array_map(function ($listener) {
$listener($this);
}, $this->listeners['ending']);

$this->initialized = false;

$this->disconnectDatabase();
Expand All @@ -49,6 +53,10 @@ public function end()
}
$this->untagCache();
$this->resetFileSystemRootPaths();

array_map(function ($listener) {
$listener($this);
}, $this->listeners['ended']);
}

public function switchDatabaseConnection()
Expand Down
3 changes: 2 additions & 1 deletion test
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
set -e

# for development
docker-compose up -d
printf "Variant 1\n\n"
TENANCY_TEST_REDIS_TENANCY=1 TENANCY_TEST_REDIS_CLIENT=phpredis docker-compose exec test vendor/bin/phpunit --coverage-php coverage/1.cov "$@"
printf "Variant 2\n\n"
TENANCY_TEST_REDIS_TENANCY=0 TENANCY_TEST_REDIS_CLIENT=predis docker-compose exec test vendor/bin/phpunit --coverage-php coverage/2.cov "$@"
docker-compose exec test vendor/bin/phpcov merge --clover clover.xml coverage/
docker-compose exec test vendor/bin/phpcov merge --clover clover.xml coverage/

0 comments on commit 1a88cad

Please sign in to comment.