From eb0611a1713ce5b84f8df5fe5b8b7fe90e426755 Mon Sep 17 00:00:00 2001 From: X! Date: Tue, 28 Dec 2010 15:13:42 +0000 Subject: [PATCH] assertType() is deprecated, switching usages tp assertInternalType() and assertInstanceOf() --- tests/phpunit/includes/GlobalTest.php | 2 +- tests/phpunit/includes/MessageTest.php | 4 ++-- tests/phpunit/includes/api/ApiTest.php | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/phpunit/includes/GlobalTest.php b/tests/phpunit/includes/GlobalTest.php index 599002eed0..426409e9d2 100644 --- a/tests/phpunit/includes/GlobalTest.php +++ b/tests/phpunit/includes/GlobalTest.php @@ -63,7 +63,7 @@ class GlobalTest extends PHPUnit_Framework_TestCase { function testTime() { $start = wfTime(); - $this->assertType( 'float', $start ); + $this->assertInternalType( 'float', $start ); $end = wfTime(); $this->assertTrue( $end > $start, "Time is running backwards!" ); } diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php index 22d736369b..fa696d2d55 100644 --- a/tests/phpunit/includes/MessageTest.php +++ b/tests/phpunit/includes/MessageTest.php @@ -21,8 +21,8 @@ class MessageTest extends PHPUnit_Framework_TestCase { } function testKey() { - $this->assertType( 'Message', wfMessage( 'mainpage' ) ); - $this->assertType( 'Message', wfMessage( 'i-dont-exist-evar' ) ); + $this->assertInstanceOf( 'Message', wfMessage( 'mainpage' ) ); + $this->assertInstanceOf( 'Message', wfMessage( 'i-dont-exist-evar' ) ); $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->text() ); $this->assertEquals( '<i-dont-exist-evar>', wfMessage( 'i-dont-exist-evar' )->text() ); } diff --git a/tests/phpunit/includes/api/ApiTest.php b/tests/phpunit/includes/api/ApiTest.php index 5df834dbbc..29f9869d91 100644 --- a/tests/phpunit/includes/api/ApiTest.php +++ b/tests/phpunit/includes/api/ApiTest.php @@ -70,7 +70,7 @@ class ApiTest extends ApiTestSetup { libxml_use_internal_errors( true ); $sxe = simplexml_load_string( $resp ); - $this->assertNotType( "bool", $sxe ); + $this->assertNotInternalType( "bool", $sxe ); $this->assertThat( $sxe, $this->isInstanceOf( "SimpleXMLElement" ) ); } @@ -101,7 +101,7 @@ class ApiTest extends ApiTestSetup { $result = $ret[0]; - $this->assertNotType( "bool", $result ); + $this->assertNotInternalType( "bool", $result ); $a = $result["login"]["result"]; $this->assertEquals( "NeedToken", $a ); @@ -117,7 +117,7 @@ class ApiTest extends ApiTestSetup { $result = $ret[0]; - $this->assertNotType( "bool", $result ); + $this->assertNotInternalType( "bool", $result ); $a = $result["login"]["result"]; $this->assertEquals( "WrongPass", $a ); @@ -140,8 +140,8 @@ class ApiTest extends ApiTestSetup { ); $result = $ret[0]; - $this->assertNotType( "bool", $result ); - $this->assertNotType( "null", $result["login"] ); + $this->assertNotInternalType( "bool", $result ); + $this->assertNotInternalType( "null", $result["login"] ); $a = $result["login"]["result"]; $this->assertEquals( "NeedToken", $a ); @@ -157,7 +157,7 @@ class ApiTest extends ApiTestSetup { $result = $ret[0]; - $this->assertNotType( "bool", $result ); + $this->assertNotInternalType( "bool", $result ); $a = $result["login"]["result"]; $this->assertEquals( "Success", $a ); @@ -180,9 +180,9 @@ class ApiTest extends ApiTestSetup { libxml_use_internal_errors( true ); $sxe = simplexml_load_string( $req->getContent() ); - $this->assertNotType( "bool", $sxe ); + $this->assertNotInternalType( "bool", $sxe ); $this->assertThat( $sxe, $this->isInstanceOf( "SimpleXMLElement" ) ); - $this->assertNotType( "null", $sxe->login[0] ); + $this->assertNotInternalType( "null", $sxe->login[0] ); $a = $sxe->login[0]->attributes()->result[0]; $this->assertEquals( ' result="NeedToken"', $a->asXML() ); @@ -220,7 +220,7 @@ class ApiTest extends ApiTestSetup { $req->execute(); libxml_use_internal_errors( true ); $sxe = simplexml_load_string( $req->getContent() ); - $this->assertNotType( "bool", $sxe ); + $this->assertNotInternalType( "bool", $sxe ); $this->assertThat( $sxe, $this->isInstanceOf( "SimpleXMLElement" ) ); $a = $sxe->query[0]->pages[0]->page[0]->attributes(); } -- 2.20.1