Merge "Replace use of assertType with assertInternalType and assertInstanceOf"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 10 Apr 2015 14:51:14 +0000 (14:51 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 10 Apr 2015 14:51:14 +0000 (14:51 +0000)
tests/phpunit/includes/api/query/ApiQueryTestBase.php
tests/phpunit/includes/filebackend/FileBackendTest.php
tests/phpunit/includes/json/FormatJsonTest.php
tests/phpunit/includes/utils/UIDGeneratorTest.php

index dabf72e..9e830f2 100644 (file)
@@ -56,12 +56,12 @@ STR;
         * @return array
         */
        private function validateRequestExpectedPair( $v ) {
-               $this->assertType( 'array', $v, self::PARAM_ASSERT );
+               $this->assertInternalType( 'array', $v, self::PARAM_ASSERT );
                $this->assertEquals( 2, count( $v ), self::PARAM_ASSERT );
                $this->assertArrayHasKey( 0, $v, self::PARAM_ASSERT );
                $this->assertArrayHasKey( 1, $v, self::PARAM_ASSERT );
-               $this->assertType( 'array', $v[0], self::PARAM_ASSERT );
-               $this->assertType( 'array', $v[1], self::PARAM_ASSERT );
+               $this->assertInternalType( 'array', $v[0], self::PARAM_ASSERT );
+               $this->assertInternalType( 'array', $v[1], self::PARAM_ASSERT );
 
                return $v;
        }
index bfca75a..aaa93ef 100644 (file)
@@ -2376,7 +2376,7 @@ class FileBackendTest extends MediaWikiTestCase {
 
                $status = Status::newGood();
                $sl = $this->backend->getScopedFileLocks( $paths, LockManager::LOCK_EX, $status );
-               $this->assertType( 'ScopedLock', $sl,
+               $this->assertInstanceOf( 'ScopedLock', $sl,
                        "Scoped locking of files succeeded ($backendName)." );
                $this->assertEquals( array(), $status->errors,
                        "Scoped locking of files succeeded ($backendName)." );
index f0ac6ac..8bca333 100644 (file)
@@ -159,12 +159,12 @@ class FormatJsonTest extends MediaWikiTestCase {
                $this->assertJson( $json );
 
                $st = FormatJson::parse( $json );
-               $this->assertType( 'Status', $st );
+               $this->assertInstanceOf( 'Status', $st );
                $this->assertTrue( $st->isGood() );
                $this->assertEquals( $expected, $st->getValue() );
 
                $st = FormatJson::parse( $json, FormatJson::FORCE_ASSOC );
-               $this->assertType( 'Status', $st );
+               $this->assertInstanceOf( 'Status', $st );
                $this->assertTrue( $st->isGood() );
                $this->assertEquals( $value, $st->getValue() );
        }
@@ -230,7 +230,7 @@ class FormatJsonTest extends MediaWikiTestCase {
                }
 
                $st = FormatJson::parse( $value, FormatJson::TRY_FIXING );
-               $this->assertType( 'Status', $st );
+               $this->assertInstanceOf( 'Status', $st );
                if ( $expected === false ) {
                        $this->assertFalse( $st->isOK(), 'Expected isOK() == false' );
                } else {
@@ -256,7 +256,7 @@ class FormatJsonTest extends MediaWikiTestCase {
         */
        public function testParseErrors( $value ) {
                $st = FormatJson::parse( $value );
-               $this->assertType( 'Status', $st );
+               $this->assertInstanceOf( 'Status', $st );
                $this->assertFalse( $st->isOK() );
        }
 
@@ -313,7 +313,7 @@ class FormatJsonTest extends MediaWikiTestCase {
         */
        public function testParseStripComments( $json, $expect ) {
                $st = FormatJson::parse( $json, FormatJson::STRIP_COMMENTS );
-               $this->assertType( 'Status', $st );
+               $this->assertInstanceOf( 'Status', $st );
                $this->assertTrue( $st->isGood() );
                $this->assertEquals( $expect, $st->getValue() );
        }
index 0e11cca..fedcc76 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class UIDGeneratorTest extends MediaWikiTestCase {
+class UIDGeneratorTest extends PHPUnit_Framework_TestCase {
 
        protected function tearDown() {
                // Bug: 44850
@@ -28,7 +28,7 @@ class UIDGeneratorTest extends MediaWikiTestCase {
 
                $lastId = array_shift( $ids );
 
-               $this->assertArrayEquals( array_unique( $ids ), $ids, "All generated IDs are unique." );
+               $this->assertSame( array_unique( $ids ), $ids, "All generated IDs are unique." );
 
                foreach ( $ids as $id ) {
                        $id_bin = wfBaseConvert( $id, 10, 2 );
@@ -105,8 +105,8 @@ class UIDGeneratorTest extends MediaWikiTestCase {
                $id1 = UIDGenerator::newSequentialPerNodeID( 'test', 32 );
                $id2 = UIDGenerator::newSequentialPerNodeID( 'test', 32 );
 
-               $this->assertType( 'float', $id1, "ID returned as float" );
-               $this->assertType( 'float', $id2, "ID returned as float" );
+               $this->assertInternalType( 'float', $id1, "ID returned as float" );
+               $this->assertInternalType( 'float', $id2, "ID returned as float" );
                $this->assertGreaterThan( 0, $id1, "ID greater than 1" );
                $this->assertGreaterThan( $id1, $id2, "IDs increasing in value" );
        }
@@ -118,7 +118,7 @@ class UIDGeneratorTest extends MediaWikiTestCase {
                $ids = UIDGenerator::newSequentialPerNodeIDs( 'test', 32, 5 );
                $lastId = null;
                foreach ( $ids as $id ) {
-                       $this->assertType( 'float', $id, "ID returned as float" );
+                       $this->assertInternalType( 'float', $id, "ID returned as float" );
                        $this->assertGreaterThan( 0, $id, "ID greater than 1" );
                        if ( $lastId ) {
                                $this->assertGreaterThan( $lastId, $id, "IDs increasing in value" );