We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad80a8e commit 09ac7f3Copy full SHA for 09ac7f3
1 file changed
tests/integration/InitOptionsTest.php
@@ -16,6 +16,8 @@ class InitOptionsTest extends TestCase {
16
public function testAddPageviewProps() {
17
try {
18
global $post, $wp_query;
19
+ $old_post = $post;
20
+ $old_query = $wp_query;
21
22
$post_id = wp_insert_post(
23
[
@@ -42,8 +44,8 @@ public function testAddPageviewProps() {
42
44
$this->assertArrayHasKey( 'category', $options['customProperties'] );
43
45
$this->assertEquals( 'Uncategorized', $options['customProperties']['category'] );
46
} finally {
- $post = null;
- $wp_query = null;
47
+ $post = $old_post;
48
+ $wp_query = $old_query;
49
remove_filter( 'plausible_analytics_settings', [ $this, 'enablePageviewProps' ] );
50
}
51
0 commit comments