Skip to content

Commit

Permalink
Cleanup custom table after test (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpost authored Jan 18, 2025
1 parent 427214a commit 2fe8587
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Binary file modified tests/_data/db.sqlite
Binary file not shown.
17 changes: 11 additions & 6 deletions tests/_support/Helper/Wpunit.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@

namespace Helper;

// here you can define custom actions
// all public methods declared in helper class will be available in $I

class Wpunit extends \Codeception\Module
{

class Wpunit extends \Codeception\Module {
public function _after(\Codeception\TestInterface $test) {
// Remove all logs after each test.
global $wpdb;
$wpdb->query(
$wpdb->prepare(
'DELETE FROM %i',
$wpdb->prefix . \Autoblue\Logging\DatabaseHandler::TABLE_NAME
)
);
}
}

0 comments on commit 2fe8587

Please sign in to comment.