Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/159389

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/89/159389/1

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: newchange
Gerrit-Change-Id: I6c8dca6ea7aae868c1ebe4f4e9ef486414ac73c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

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

Reply via email to