jenkins-bot has submitted this change and it was merged.

Change subject: Add tests for CentralAuthUser::newFromId()
......................................................................


Add tests for CentralAuthUser::newFromId()

Change-Id: I6c8dca6ea7aae868c1ebe4f4e9ef486414ac73c3
---
M tests/CentralAuthUserUsingDatabaseTest.php
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  BryanDavis: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/CentralAuthUserUsingDatabaseTest.php 
b/tests/CentralAuthUserUsingDatabaseTest.php
index e94369d..c6ea48b 100644
--- a/tests/CentralAuthUserUsingDatabaseTest.php
+++ b/tests/CentralAuthUserUsingDatabaseTest.php
@@ -49,6 +49,17 @@
        }
 
        /**
+        * @covers CentralAuthUser::newFromId
+        */
+       public function testNewFromId() {
+               $ca = CentralAuthUser::newFromId( 1001 );
+               $this->assertEquals( 'GlobalUser', $ca->getName() );
+
+               $caBad = CentralAuthUser::newFromId( -1001 );
+               $this->assertFalse( $caBad );
+       }
+
+       /**
         * Setup a fresh set of global users for each test.
         * Note: MediaWikiTestCase::resetDB() will delete all tables between
         * test runs, so no explicite tearDown() is needed.

-- 
To view, visit https://gerrit.wikimedia.org/r/159389
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6c8dca6ea7aae868c1ebe4f4e9ef486414ac73c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to