FauxRequest: Complete code coverage for FauxRequestTest
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 1 Apr 2017 01:22:58 +0000 (18:22 -0700)
committerKrinkle <krinklemail@gmail.com>
Sat, 1 Apr 2017 01:25:02 +0000 (01:25 +0000)
Follows-up d18d030d57b88.

* Add missing case of session being a Session object.

Change-Id: I7da0c6d4a6483d53bcfd56751cd1cb669bd5023e

tests/phpunit/includes/FauxRequestTest.php

index e3713ab..9fe694d 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use MediaWiki\Session\SessionManager;
+
 class FauxRequestTest extends PHPUnit_Framework_TestCase {
        /**
         * @covers FauxRequest::__construct
@@ -17,6 +19,17 @@ class FauxRequestTest extends PHPUnit_Framework_TestCase {
                $req = new FauxRequest( [], false, 'x' );
        }
 
+       /**
+        * @covers FauxRequest::__construct
+        */
+       public function testConstructWithSession() {
+               $session = SessionManager::singleton()->getEmptySession( new FauxRequest( [] ) );
+               $this->assertInstanceOf(
+                       FauxRequest::class,
+                       new FauxRequest( [], false, $session )
+               );
+       }
+
        /**
         * @covers FauxRequest::getText
         */