Permalink
Browse files

Test case compatibility assertIsA() to assertInstanceOf()

  • Loading branch information...
shama authored and markstory committed Nov 16, 2011
1 parent 98f03dc commit c97dca1570d755fb7b224fd2efb302c919314468
@@ -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);
}
/**
@@ -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);
}
/**
@@ -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');
@@ -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
@@ -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)));
@@ -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'));
@@ -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);
@@ -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);
@@ -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');
}
@@ -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);
}
/**
@@ -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.');
@@ -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);
}

0 comments on commit c97dca1

Please sign in to comment.