diff --git a/tests/test-module-role-defaults.php b/tests/test-module-role-defaults.php index 886fb44e..cbe4adbf 100644 --- a/tests/test-module-role-defaults.php +++ b/tests/test-module-role-defaults.php @@ -140,14 +140,14 @@ function test_import_export() { // @todo Patch if data only is possible. $result = $class->import_role_defaults( $editor_import ); - $this->assertNotEquals( true, $result ); + $this->assertNotSame( true, $result ); $import = array( 'editor' => $editor_import, ); $result = $class->import_role_defaults( $import ); - $this->assertEquals( true, $result ); + $this->assertSame( true, $result ); $this->assertEquals( $import, $class->get_role_defaults() ); /** @@ -157,7 +157,7 @@ function test_import_export() { $result = $class->import_role_defaults( $import ); // Should return error list array because of the invalid meta key. - $this->assertNotEquals( true, $result ); + $this->assertNotSame( true, $result ); // Make sure the key doesn't exists in the role defaults. unset( $import['editor']['invalid_key'] ); @@ -170,7 +170,7 @@ function test_import_export() { $overwrite['editor']['admin_color'] = 'dark'; $result = $class->import_role_defaults( $overwrite, 'merge' ); - $this->assertEquals( true, $result ); + $this->assertSame( true, $result ); // Check export import overwrite. $this->assertEquals( $overwrite, $class->export_role_defaults() ); @@ -180,7 +180,7 @@ function test_import_export() { * Import append. */ $result = $class->import_role_defaults( $import, 'append' ); - $this->assertEquals( true, $result ); + $this->assertSame( true, $result ); // Check export import append. Editor admin color should still be `dark`. $this->assertEquals( $overwrite, $class->export_role_defaults() ); @@ -192,7 +192,7 @@ function test_import_export() { ), ); $result = $class->import_role_defaults( $import_admin ); - $this->assertEquals( true, $result ); + $this->assertSame( true, $result ); /** * Check export for a single role. @@ -225,13 +225,13 @@ function test_get_copy() { * Invalid, non existing role. */ $result = $class->copy_role_defaults( 'editor', 'non_existing_role' ); - $this->assertNotEquals( true, $result ); + $this->assertNotSame( true, $result ); /** * Copy defaults. */ $result = $class->copy_role_defaults( 'editor', 'author' ); - $this->assertEquals( true, $result ); + $this->assertSame( true, $result ); // Check if copy was actually successful. Also checks getting role defaults with role parameter. $check = array( @@ -260,7 +260,7 @@ function test_clear() { */ $result = $class->clear_role_defaults( 'non_existing_role' ); // @todo Currently still returns true, maybe return false if role doesn't exists? - $this->assertEquals( true, $result ); + $this->assertSame( true, $result ); // Should still be the same. $this->assertEquals( $defaults, $class->get_role_defaults() ); @@ -268,7 +268,7 @@ function test_clear() { * Clear defaults, single role. */ $result = $class->clear_role_defaults( 'author' ); - $this->assertEquals( true, $result ); + $this->assertSame( true, $result ); $new_defaults = $defaults; unset( $new_defaults['author'] ); @@ -279,7 +279,7 @@ function test_clear() { * Clear all. */ $result = $class->clear_role_defaults( '__all__' ); - $this->assertEquals( true, $result ); + $this->assertSame( true, $result ); $this->assertEquals( array(), $class->get_role_defaults() ); diff --git a/tests/test-module-role-manager.php b/tests/test-module-role-manager.php index 48b73439..ab3b08db 100644 --- a/tests/test-module-role-manager.php +++ b/tests/test-module-role-manager.php @@ -102,7 +102,7 @@ function test_import() { */ $result = $class->import_roles( 'test' ); // We expect an error string. - $this->assertNotEquals( true, $result ); + $this->assertNotSame( true, $result ); $caps = array( 'read' => array( 'yay' ), @@ -110,7 +110,7 @@ function test_import() { ); $result = $class->import_roles( $caps ); // We expect an error array. - $this->assertNotEquals( true, $result ); + $this->assertNotSame( true, $result ); /** * Correct. @@ -123,7 +123,7 @@ function test_import() { $result = $class->import_roles( array( 'data' => array( $role => $caps ), ) ); - $this->assertEquals( true, $result ); + $this->assertSame( true, $result ); $test_import = get_role( $role ); @@ -144,14 +144,14 @@ function test_clone() { */ $result = $class->clone_role( 'non_existing_role', $role ); // We expect an error string. - $this->assertNotEquals( true, $result ); + $this->assertNotSame( true, $result ); /** * Correct. */ $result = $class->clone_role( 'editor', $role ); // We expect an error string. - $this->assertEquals( true, $result ); + $this->assertSame( true, $result ); $editor = get_role( 'editor' ); $test_clone = get_role( $role ); @@ -173,24 +173,24 @@ function test_rename() { */ $result = $class->rename_role( 'non_existing_role', $rename ); // We expect an error string. - $this->assertNotEquals( true, $result ); + $this->assertNotSame( true, $result ); /** * Correct. */ $result = $class->rename_role( 'editor', $rename ); // We expect an error string. - $this->assertEquals( true, $result ); + $this->assertSame( true, $result ); $editor = get_role( 'editor' ); // The editor name should be the new name. - $this->assertEquals( $editor->name, $rename ); + $this->assertSame( $editor->name, $rename ); // Revert change. $class->rename_role( 'editor', 'Editor' ); $editor = get_role( 'editor' ); // Verify that the role is renamed. - $this->assertEquals( $editor->name, 'Editor' ); + $this->assertSame( $editor->name, 'Editor' ); } @@ -208,18 +208,18 @@ function test_delete() { */ $result = $class->delete_role( 'non_existing_role' ); // We expect an error string. - $this->assertNotEquals( true, $result ); + $this->assertNotSame( true, $result ); /** * Protected roles. */ $result = $class->delete_role( 'administrator' ); // We expect an error string. - $this->assertNotEquals( true, $result ); + $this->assertNotSame( true, $result ); $result = $class->delete_role( get_option( 'default_role' ) ); // We expect an error string. - $this->assertNotEquals( true, $result ); + $this->assertNotSame( true, $result ); /** * Correct. @@ -258,11 +258,11 @@ function test_migrate_users() { */ $result = $class->delete_role( 'editor', 'non_existing_role' ); // We expect an error string. - $this->assertNotEquals( true, $result ); + $this->assertNotSame( true, $result ); $result = $class->delete_role( 'editor', 'editor' ); // We expect an error string. - $this->assertNotEquals( true, $result ); + $this->assertNotSame( true, $result ); /** * Correct. @@ -271,7 +271,7 @@ function test_migrate_users() { $result = $class->delete_role( 'editor', 'test_migrate' ); // Should be ok! - $this->assertEquals( true, $result ); + $this->assertSame( true, $result ); /** * Revert @@ -284,7 +284,7 @@ function test_migrate_users() { 'new_role' => 'editor', ) ); // Should be ok! - $this->assertEquals( true, $result ); + $this->assertSame( true, $result ); // Load all roles again after removal. VAA_UnitTest_Factory::vaa_reinit();