Skip to content

Commit 689cb33

Browse files
Tests: Cover wp_strict_cross_origin_referrer().
Verify the expected output of `<meta name='referrer' content='strict-origin-when-cross-origin' />` tag. Developed in #15355. Props devmuhib, huzaifaalmesbah, lancewillett. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@65667 602fd350-edb4-49c9-b593-d223f7449a82
1 parent bb6f370 commit 689cb33

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
/**
4+
* Tests for the `wp_strict_cross_origin_referrer()` function.
5+
*
6+
* @group general
7+
* @group template
8+
*
9+
* @covers ::wp_strict_cross_origin_referrer
10+
*/
11+
class Tests_General_WpStrictCrossOriginReferrer extends WP_UnitTestCase {
12+
13+
/**
14+
* Tests that wp_strict_cross_origin_referrer() outputs the expected meta tag.
15+
*
16+
* @ticket 65819
17+
*/
18+
public function test_wp_strict_cross_origin_referrer_output() {
19+
$expected = "<meta name='referrer' content='strict-origin-when-cross-origin' />";
20+
21+
ob_start();
22+
wp_strict_cross_origin_referrer();
23+
$actual = trim( ob_get_clean() );
24+
25+
$this->assertSame( $expected, $actual );
26+
}
27+
}

0 commit comments

Comments
 (0)