are not allowed here', ' we should trim leading and trailing whitespace ', 'we also trim extra internal whitespace', 'tabs get removed too', 'newlines are not welcome here', 'We also %AB remove %ab octets', 'We don\'t need to wory about %A B removing %a b octets even when %a B they are obscured by whitespace', '%AB%BC%DE', //Just octets 'Invalid octects remain %II', 'Nested octects %%%ABABAB %A%A%ABBB', ); $expected = array( 'оРангутанг', 'САПР', 'one is < two', 'tags are not allowed here', 'we should trim leading and trailing whitespace', 'we also trim extra internal whitespace', 'tabs get removed too', 'newlines are not welcome here', 'We also remove octets', 'We don\'t need to wory about %A B removing %a b octets even when %a B they are obscured by whitespace', '', //Emtpy as we strip all the octets out 'Invalid octects remain %II', 'Nested octects', ); foreach ($inputs as $key => $input) { $this->assertEquals($expected[$key], sanitize_text_field($input)); } } }