Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Oct 24, 2023
1 parent 6e34dc9 commit 4bcb875
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion 001-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function vip_prevent_invalid_core_query_args() {

/**
* Only allow HTTPS origins on VIP
*
*
* @param array $origins
*/
function vip_only_https_origins( $origins ) {
Expand Down
17 changes: 17 additions & 0 deletions tests/test-core-filters.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

class Core_Filters_Test extends WP_UnitTestCase {
public function test_vip_only_https_origins(): void {
$input = [
0 => 'http://example.com',
1 => 'https://example.com',
];

$expected = [
1 => 'https://example.com',
];

$actual = vip_only_https_origins( $input );
self::assertSame( $expected, $actual );
}
}

0 comments on commit 4bcb875

Please sign in to comment.