-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47c0efc
commit b309fac
Showing
4 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Our mock for the global `wp_hash` function. | ||
* | ||
* @package ForceRefresh | ||
*/ | ||
|
||
namespace JordanLeven\Plugins\ForceRefresh\Mocks; | ||
|
||
/** | ||
* Class for the `wp_hash` Mock | ||
*/ | ||
final class Mock_WP_Hash extends Mock_Function implements Mock_Function_Interface { | ||
|
||
/** | ||
* The name of the function to mock. | ||
* | ||
* @var string | ||
*/ | ||
const MOCK_FUNCTION_NAME = 'wp_hash'; | ||
|
||
/** | ||
* Class constructor. | ||
* | ||
* @param string $mock_namespace The namespace for the function to be mocked. | ||
*/ | ||
public function __construct( string $mock_namespace ) { | ||
$mock_implementation = fn( $a ) => sprintf( 'hash-%s', $a ); | ||
parent::__construct( $mock_namespace, self::MOCK_FUNCTION_NAME, $mock_implementation ); | ||
} | ||
} |