Skip to content

Commit c97dca1

Browse files
shamamarkstory
authored andcommitted
Test case compatibility assertIsA() to assertInstanceOf()
1 parent 98f03dc commit c97dca1

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

lib/Cake/Test/Case/Model/ModelIntegrationTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -997,13 +997,13 @@ public function testInvalidAssociation() {
997997
public function testLoadModelSecondIteration() {
998998
$this->loadFixtures('Apple', 'Message', 'Thread', 'Bid');
999999
$model = new ModelA();
1000-
$this->assertIsA($model,'ModelA');
1000+
$this->assertInstanceOf('ModelA', $model);
10011001

1002-
$this->assertIsA($model->ModelB, 'ModelB');
1003-
$this->assertIsA($model->ModelB->ModelD, 'ModelD');
1002+
$this->assertInstanceOf('ModelB', $model->ModelB);
1003+
$this->assertInstanceOf('ModelD', $model->ModelB->ModelD);
10041004

1005-
$this->assertIsA($model->ModelC, 'ModelC');
1006-
$this->assertIsA($model->ModelC->ModelD, 'ModelD');
1005+
$this->assertInstanceOf('ModelC', $model->ModelC);
1006+
$this->assertInstanceOf('ModelD', $model->ModelC->ModelD);
10071007
}
10081008

10091009
/**

lib/Cake/Test/Case/Network/Email/CakeEmailTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ public function testHeaders() {
495495
$this->assertSame($this->CakeEmail->getHeaders(array('from' => true, 'to' => true)), $expected);
496496

497497
$result = $this->CakeEmail->setHeaders(array());
498-
$this->assertIsA($result, 'CakeEmail');
498+
$this->assertInstanceOf('CakeEmail', $result);
499499
}
500500

501501
/**
@@ -616,7 +616,7 @@ public function testTransport() {
616616
$this->assertSame($this->CakeEmail->transport(), 'Debug');
617617

618618
$result = $this->CakeEmail->transportClass();
619-
$this->assertIsA($result, 'DebugTransport');
619+
$this->assertInstanceOf('DebugTransport', $result);
620620

621621
$this->setExpectedException('SocketException');
622622
$this->CakeEmail->transport('Invalid');
@@ -674,7 +674,7 @@ public function testConfigString() {
674674
$this->assertEquals($configs->test['transport'], $result);
675675

676676
$result = $this->CakeEmail->transportClass();
677-
$this->assertIsA($result, 'DebugTransport');
677+
$this->assertInstanceOf('DebugTransport', $result);
678678
}
679679
/**
680680
* testSendWithContent method
@@ -879,7 +879,7 @@ public function testSendRenderWithHelpers() {
879879
$this->CakeEmail->viewVars(array('time' => $timestamp));
880880

881881
$result = $this->CakeEmail->helpers(array('Time'));
882-
$this->assertIsA($result, 'CakeEmail');
882+
$this->assertInstanceOf('CakeEmail', $result);
883883

884884
$result = $this->CakeEmail->send();
885885
$this->assertTrue((bool)strpos($result['message'], 'Right now: ' . date('Y-m-d\TH:i:s\Z', $timestamp)));
@@ -1001,7 +1001,7 @@ public function testSendAttachment() {
10011001
*/
10021002
public function testDeliver() {
10031003
$instance = CakeEmail::deliver('all@cakephp.org', 'About', 'Everything ok', array('from' => 'root@cakephp.org'), false);
1004-
$this->assertIsA($instance, 'CakeEmail');
1004+
$this->assertInstanceOf('CakeEmail', $instance);
10051005
$this->assertSame($instance->to(), array('all@cakephp.org' => 'all@cakephp.org'));
10061006
$this->assertSame($instance->subject(), 'About');
10071007
$this->assertSame($instance->from(), array('root@cakephp.org' => 'root@cakephp.org'));
@@ -1223,7 +1223,7 @@ public function testViewRender() {
12231223
$this->assertEquals('View', $result);
12241224

12251225
$result = $this->CakeEmail->viewRender('Theme');
1226-
$this->assertIsA($result, 'CakeEmail');
1226+
$this->assertInstanceOf('CakeEmail', $result);
12271227

12281228
$result = $this->CakeEmail->viewRender();
12291229
$this->assertEquals('Theme', $result);
@@ -1239,7 +1239,7 @@ public function testEmailFormat() {
12391239
$this->assertEquals('text', $result);
12401240

12411241
$result = $this->CakeEmail->emailFormat('html');
1242-
$this->assertIsA($result, 'CakeEmail');
1242+
$this->assertInstanceOf('CakeEmail', $result);
12431243

12441244
$result = $this->CakeEmail->emailFormat();
12451245
$this->assertEquals('html', $result);

lib/Cake/Test/Case/Network/Http/HttpSocketTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ public function testRequestCustomResponse() {
709709

710710
$this->Socket->responseClass = 'CustomResponse';
711711
$response = $this->Socket->request('http://www.cakephp.org/');
712-
$this->assertIsA($response, 'CustomResponse');
712+
$this->assertInstanceOf('CustomResponse', $response);
713713
$this->assertEquals($response->first10, 'HTTP/1.x 2');
714714
}
715715

lib/Cake/Test/Case/Utility/DebuggerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,16 +383,16 @@ public function testDump() {
383383
*/
384384
public function testGetInstance() {
385385
$result = Debugger::getInstance();
386-
$this->assertIsA($result, 'Debugger');
386+
$this->assertInstanceOf('Debugger', $result);
387387

388388
$result = Debugger::getInstance('DebuggerTestCaseDebugger');
389-
$this->assertIsA($result, 'DebuggerTestCaseDebugger');
389+
$this->assertInstanceOf('DebuggerTestCaseDebugger', $result);
390390

391391
$result = Debugger::getInstance();
392-
$this->assertIsA($result, 'DebuggerTestCaseDebugger');
392+
$this->assertInstanceOf('DebuggerTestCaseDebugger', $result);
393393

394394
$result = Debugger::getInstance('Debugger');
395-
$this->assertIsA($result, 'Debugger');
395+
$this->assertInstanceOf('Debugger', $result);
396396
}
397397

398398
/**

lib/Cake/Test/Case/Utility/FileTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function testBasic() {
107107
$this->assertEquals($expecting, $result);
108108

109109
$result = $this->File->Folder();
110-
$this->assertIsA($result, 'Folder');
110+
$this->assertInstanceOf('Folder', $result);
111111

112112
$this->skipIf(DIRECTORY_SEPARATOR === '\\', 'File permissions tests not supported on Windows.');
113113

lib/Cake/Test/Case/Utility/ObjectCollectionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ public function testSet() {
144144
$this->assertEquals(array('First'), $result, 'loaded objects are wrong');
145145

146146
$result = $this->Objects->set('First', new SecondGenericObject());
147-
$this->assertIsA($result['First'], 'SecondGenericObject', 'set failed');
147+
$this->assertInstanceOf('SecondGenericObject', $result['First'], 'set failed');
148148

149149
$result = $this->Objects->set('Second', new SecondGenericObject());
150-
$this->assertIsA($result['Second'], 'SecondGenericObject', 'set failed');
150+
$this->assertInstanceOf('SecondGenericObject', $result['Second'], 'set failed');
151151

152152
$this->assertEquals(count($result), 2);
153153
}

0 commit comments

Comments
 (0)