"Caring is not in scope, but we do it anyway"
- David Droga
function my_permalink_function( $id ){
return str_replace( 'foo', 'bar', get_permalink( $id ) );
}
public function my_test(){
\WP_Mock::wpFunction( 'get_permalink', array(
'args' => 42,
'return' => 'http://example.com/foo'
) );
$result = my_permalink_function( 42 );
$this->assertEquals( 'https://example.com/bar', $result );
}