X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=blobdiff_plain;ds=sidebyside;f=tests%2Fphpunit%2Fincludes%2FTestUserRegistry.php;h=0c178ca128cc807ed4aab1e43d3c519b2f726a5a;hb=5ab1bee6bcf83bd133b48c79fd72da92f58037d4;hp=4818b49a34d664297e4cf9963ac62a03de219313;hpb=adae996840b9e782f6e14b21c433a83e37c3a74e;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/TestUserRegistry.php b/tests/phpunit/includes/TestUserRegistry.php index 4818b49a34..0c178ca128 100644 --- a/tests/phpunit/includes/TestUserRegistry.php +++ b/tests/phpunit/includes/TestUserRegistry.php @@ -107,4 +107,19 @@ class TestUserRegistry { public static function clear() { self::$testUsers = []; } + + /** + * @todo It would be nice if this were a non-static method of TestUser + * instead, but that doesn't seem possible without friends? + * + * @return bool True if it's safe to modify the user + */ + public static function isMutable( User $user ) { + foreach ( self::$testUsers as $key => $testUser ) { + if ( $user === $testUser->getUser() ) { + return false; + } + } + return true; + } }