Skip to content

Commit

Permalink
fix: install database tables after reactivate plugin (#52k7f1)
Browse files Browse the repository at this point in the history
  • Loading branch information
matzeeable committed May 5, 2020
1 parent 3bdca45 commit f9898d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/utils/src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ protected function construct() {
dirname(__DIR__)
)->hooks();

register_activation_hook($pluginFile, [$this->getActivator(), 'install']);
register_activation_hook($pluginFile, [$this->getActivator(), 'activate']);
register_deactivation_hook($pluginFile, [$this->getActivator(), 'deactivate']);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/utils/test/phpunit/CoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public function testConstruct() {
'times' => 1,
'args' => [PHPUNIT_FILE, [$mockActivator, 'activate']]
]);
WP_Mock::userFunction('register_activation_hook', [
'times' => 1,
'args' => [PHPUNIT_FILE, [$mockActivator, 'install']]
]);
WP_Mock::userFunction('register_deactivation_hook', [
'times' => 1,
'args' => [PHPUNIT_FILE, [$mockActivator, 'deactivate']]
Expand Down

0 comments on commit f9898d4

Please sign in to comment.