* @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;
}
$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)." );
$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() );
}
}
$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 {
*/
public function testParseErrors( $value ) {
$st = FormatJson::parse( $value );
- $this->assertType( 'Status', $st );
+ $this->assertInstanceOf( 'Status', $st );
$this->assertFalse( $st->isOK() );
}
*/
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() );
}
<?php
-class UIDGeneratorTest extends MediaWikiTestCase {
+class UIDGeneratorTest extends PHPUnit_Framework_TestCase {
protected function tearDown() {
// Bug: 44850
$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 );
$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" );
}
$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" );