Skip to content

Commit

Permalink
Added: FiltersTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan0sz committed Jul 17, 2024
1 parent ef61e64 commit 032808a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/integration/FiltersTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
* @package Plausible Analytics Integration Tests - Helpers
*/

namespace Plausible\Analytics\Tests\Integration;

use Plausible\Analytics\Tests\TestCase;
use Plausible\Analytics\WP\Filters;

class FiltersTest extends TestCase {
/**
* @see Filters::add_plausible_attributes()
*/
public function testAddPlausibleAttributes() {
$class = new Filters();
$tag = $class->add_plausible_attributes( '<script id="plausible-analytics-js" src="test.js">', 'plausible-analytics' );

$this->assertStringContainsString( 'example.org', $tag );
$this->assertStringContainsString( 'plausible.io/api/event', $tag );
$this->assertStringNotContainsString( 'plausible-analytics-js', $tag );
}
}

0 comments on commit 032808a

Please sign in to comment.