Skip to content

Commit

Permalink
Test case compatibility assertIsA() to assertInstanceOf()
Browse files Browse the repository at this point in the history
  • Loading branch information
shama authored and markstory committed Nov 17, 2011
1 parent 98f03dc commit c97dca1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions lib/Cake/Test/Case/Model/ModelIntegrationTest.php
Expand Up @@ -997,13 +997,13 @@ public function testInvalidAssociation() {
public function testLoadModelSecondIteration() {
$this->loadFixtures('Apple', 'Message', 'Thread', 'Bid');
$model = new ModelA();
$this->assertIsA($model,'ModelA');
$this->assertInstanceOf('ModelA', $model);

$this->assertIsA($model->ModelB, 'ModelB');
$this->assertIsA($model->ModelB->ModelD, 'ModelD');
$this->assertInstanceOf('ModelB', $model->ModelB);
$this->assertInstanceOf('ModelD', $model->ModelB->ModelD);

$this->assertIsA($model->ModelC, 'ModelC');
$this->assertIsA($model->ModelC->ModelD, 'ModelD');
$this->assertInstanceOf('ModelC', $model->ModelC);
$this->assertInstanceOf('ModelD', $model->ModelC->ModelD);
}

/**
Expand Down
14 changes: 7 additions & 7 deletions lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
Expand Up @@ -495,7 +495,7 @@ public function testHeaders() {
$this->assertSame($this->CakeEmail->getHeaders(array('from' => true, 'to' => true)), $expected);

$result = $this->CakeEmail->setHeaders(array());
$this->assertIsA($result, 'CakeEmail');
$this->assertInstanceOf('CakeEmail', $result);
}

/**
Expand Down Expand Up @@ -616,7 +616,7 @@ public function testTransport() {
$this->assertSame($this->CakeEmail->transport(), 'Debug');

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

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

$result = $this->CakeEmail->transportClass();
$this->assertIsA($result, 'DebugTransport');
$this->assertInstanceOf('DebugTransport', $result);
}
/**
* testSendWithContent method
Expand Down Expand Up @@ -879,7 +879,7 @@ public function testSendRenderWithHelpers() {
$this->CakeEmail->viewVars(array('time' => $timestamp));

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

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

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

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

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

$result = $this->CakeEmail->emailFormat();
$this->assertEquals('html', $result);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Network/Http/HttpSocketTest.php
Expand Up @@ -709,7 +709,7 @@ public function testRequestCustomResponse() {

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

Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/Test/Case/Utility/DebuggerTest.php
Expand Up @@ -383,16 +383,16 @@ public function testDump() {
*/
public function testGetInstance() {
$result = Debugger::getInstance();
$this->assertIsA($result, 'Debugger');
$this->assertInstanceOf('Debugger', $result);

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

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

$result = Debugger::getInstance('Debugger');
$this->assertIsA($result, 'Debugger');
$this->assertInstanceOf('Debugger', $result);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Utility/FileTest.php
Expand Up @@ -107,7 +107,7 @@ public function testBasic() {
$this->assertEquals($expecting, $result);

$result = $this->File->Folder();
$this->assertIsA($result, 'Folder');
$this->assertInstanceOf('Folder', $result);

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

Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Utility/ObjectCollectionTest.php
Expand Up @@ -144,10 +144,10 @@ public function testSet() {
$this->assertEquals(array('First'), $result, 'loaded objects are wrong');

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

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

$this->assertEquals(count($result), 2);
}
Expand Down

0 comments on commit c97dca1

Please sign in to comment.