Coding Standards: Fix the remaining issues in /tests.

All PHP files in `/tests` now conform to the PHP coding standards, or have exceptions appropriately marked.

Travis now also runs `phpcs` on the `/tests` directory, any future changes to these files must conform entirely to the WordPress PHP coding standards. 🎉

See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45607 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2019-07-08 00:55:20 +00:00
parent 431bc58a48
commit c6c78490e2
91 changed files with 435 additions and 320 deletions
+9 -9
View File
@@ -61,12 +61,12 @@ class WP_Filesystem_MockFS extends WP_Filesystem_Base {
foreach ( $paths as $path ) {
// Allow for comments
if ( '#' == $path[0] ) {
if ( '#' === $path[0] ) {
continue;
}
// Directories
if ( '/' == $path[ strlen( $path ) - 1 ] ) {
if ( '/' === $path[ strlen( $path ) - 1 ] ) {
$this->mkdir( $path );
} else { // Files (with dummy content for now)
$this->put_contents( $path, 'This is a test file' );
@@ -161,7 +161,7 @@ class WP_Filesystem_MockFS extends WP_Filesystem_Base {
function dirlist( $path = '.', $include_hidden = true, $recursive = false ) {
if ( empty( $path ) || '.' == $path ) {
if ( empty( $path ) || '.' === $path ) {
$path = $this->cwd();
}
@@ -177,15 +177,15 @@ class WP_Filesystem_MockFS extends WP_Filesystem_Base {
$ret = array();
foreach ( $this->fs_map[ $path ]->children as $entry ) {
if ( '.' == $entry->name || '..' == $entry->name ) {
if ( '.' === $entry->name || '..' === $entry->name ) {
continue;
}
if ( ! $include_hidden && '.' == $entry->name ) {
if ( ! $include_hidden && '.' === $entry->name ) {
continue;
}
if ( $limit_file && $entry->name != $limit_file ) {
if ( $limit_file && $entry->name !== $limit_file ) {
continue;
}
@@ -193,7 +193,7 @@ class WP_Filesystem_MockFS extends WP_Filesystem_Base {
$struc['name'] = $entry->name;
$struc['type'] = $entry->type;
if ( 'd' == $struc['type'] ) {
if ( 'd' === $struc['type'] ) {
if ( $recursive ) {
$struc['files'] = $this->dirlist( trailingslashit( $path ) . trailingslashit( $struc['name'] ), $include_hidden, $recursive );
} else {
@@ -219,11 +219,11 @@ class MockFS_Node {
}
function is_file() {
return $this->type == 'f';
return 'f' === $this->type;
}
function is_dir() {
return $this->type == 'd';
return 'd' === $this->type;
}
}