Skip to content

Commit

Permalink
Fix wordpress database setup in benchmark tests
Browse files Browse the repository at this point in the history
  • Loading branch information
estringana committed Sep 20, 2024
1 parent f38dddc commit 339adfc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/Benchmarks/Integrations/WordPressBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class WordPressBench extends FrameworkBenchmarksCase
{
/**
* @BeforeMethods("enableDatadog")
* @BeforeMethods({"enableDatadog", "createDatabase"})
* @AfterMethods("afterMethod")
* @Revs(10)
* @Iterations(10)
Expand All @@ -34,12 +34,11 @@ public static function getAppIndexScript()
return __DIR__ . '/../../Frameworks/WordPress/Version_6_1/index.php';
}

public function disableWordPressTracing()
public function createDatabase(): void
{
$pdo = new \PDO('mysql:host=mysql_integration', 'test', 'test');
$pdo->exec('CREATE DATABASE IF NOT EXISTS wp61');
$pdo->exec(file_get_contents(__DIR__ . '/../../Frameworks/WordPress/Version_6_1/scripts/wp_initdb.sql'));
$this->disableDatadog();
}

public function afterMethod()
Expand All @@ -48,7 +47,7 @@ public function afterMethod()
}

/**
* @BeforeMethods("disableWordPressTracing")
* @BeforeMethods({"disableDatadog", "createDatabase"})
* @AfterMethods("afterMethod")
* @Revs(10)
* @Iterations(10)
Expand Down

0 comments on commit 339adfc

Please sign in to comment.