Skip to content

Commit 14edec3

Browse files
committed
fix: stabilize phpunit config and tracking test
1 parent 7f9051b commit 14edec3

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

‎phpunit.xml.dist‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
12
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
25
bootstrap="tests/bootstrap.php"
36
backupGlobals="false"
47
colors="true"
@@ -7,7 +10,7 @@
710
convertWarningsToExceptions="true"
811
>
912
<testsuites>
10-
<testsuite>
13+
<testsuite name="plugin">
1114
<directory prefix="test-" suffix=".php">./tests/</directory>
1215
</testsuite>
1316
</testsuites>

‎tests/test-factory.php‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,8 @@ public function setUp(): void
3131

3232
function test_tracking_code_output()
3333
{
34-
35-
ob_start();
36-
37-
wp_head();
38-
39-
$head_contents = ob_get_clean();
40-
41-
$output_analytics = strpos($head_contents, "id='wk-analytics-script-js-after'") > -1;
42-
43-
$this->assertTrue($output_analytics);
34+
do_action('wp_enqueue_scripts');
35+
$this->assertTrue(wp_script_is('wk-analytics-script', 'enqueued'));
4436

4537
}
4638

0 commit comments

Comments
 (0)