| | 74 | * @ticket 17689 |
| | 75 | */ |
| | 76 | function test_term_exists_non_duplicate_on_characters_stripped_by_sanitize_title() { |
| | 77 | // Create two different random strings that when sanitized would produce the same result. |
| | 78 | $termA = '$-+/ $' . rand_str(); |
| | 79 | $termB = '$+ $ * -' . $termA; |
| | 80 | // Insert the first one to the database |
| | 81 | $tA = wp_insert_term( $termA, $this->taxonomy ); |
| | 82 | |
| | 83 | // And check if the second one exists. |
| | 84 | $exists = term_exists( $termB, $this->taxonomy ); |
| | 85 | |
| | 86 | // term_exists() returns 0 when nothing found. |
| | 87 | $this->assertEquals(0,$exists); |
| | 88 | } |
| | 89 | |
| | 90 | /** |