a9c65f55d6
* show admin notice when permalink structure is plain fix #609 * fix phpcs issues * remove calculation of static array of issues * small changes * removed unused attribute --------- Co-authored-by: Matthew Exon <git.mexon@spamgourmet.com> Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
18 lines
546 B
PHP
18 lines
546 B
PHP
<?php
|
|
class Test_Admin extends WP_UnitTestCase {
|
|
public function test_no_permalink_structure_has_errors() {
|
|
\add_option( 'permalink_structure', '' );
|
|
\do_action( 'admin_notices' );
|
|
$this->expectOutputRegex( "/notice-error/" );
|
|
|
|
\delete_option( 'permalink_structure' );
|
|
}
|
|
|
|
public function test_has_permalink_structure_no_errors() {
|
|
\add_option( 'permalink_structure', '/archives/%post_id%' );
|
|
\do_action( 'admin_notices' );
|
|
$this->expectOutputRegex( "/^((?!notice-error).)*$/s" );
|
|
|
|
\delete_option( 'permalink_structure' );
|
|
}
|
|
}
|