Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix indentation.

  • Loading branch information...
commit b8e27c7588dd6fa4fec3ccb31f30ad58cd1b5706 1 parent 354716c
@markstory markstory authored
Showing with 52 additions and 52 deletions.
  1. +52 −52 lib/Cake/Test/Case/Model/ModelWriteTest.php
View
104 lib/Cake/Test/Case/Model/ModelWriteTest.php
@@ -24,62 +24,62 @@
*/
class ModelWriteTest extends BaseModelTest {
- /**
- * testInsertAnotherHabtmRecordWithSameForeignKey method
- *
- * @access public
- * @return void
- */
- public function testInsertAnotherHabtmRecordWithSameForeignKey() {
- $this->loadFixtures('JoinA', 'JoinB', 'JoinAB', 'JoinC', 'JoinAC');
- $TestModel = new JoinA();
-
- $result = $TestModel->JoinAsJoinB->findById(1);
- $expected = array(
- 'JoinAsJoinB' => array(
- 'id' => 1,
- 'join_a_id' => 1,
- 'join_b_id' => 2,
- 'other' => 'Data for Join A 1 Join B 2',
- 'created' => '2008-01-03 10:56:33',
- 'updated' => '2008-01-03 10:56:33'
- ));
- $this->assertEquals($expected, $result);
+/**
+ * testInsertAnotherHabtmRecordWithSameForeignKey method
+ *
+ * @access public
+ * @return void
+ */
+ public function testInsertAnotherHabtmRecordWithSameForeignKey() {
+ $this->loadFixtures('JoinA', 'JoinB', 'JoinAB', 'JoinC', 'JoinAC');
+ $TestModel = new JoinA();
- $TestModel->JoinAsJoinB->create();
- $data = array(
+ $result = $TestModel->JoinAsJoinB->findById(1);
+ $expected = array(
+ 'JoinAsJoinB' => array(
+ 'id' => 1,
'join_a_id' => 1,
- 'join_b_id' => 1,
- 'other' => 'Data for Join A 1 Join B 1',
- 'created' => '2008-01-03 10:56:44',
- 'updated' => '2008-01-03 10:56:44'
- );
- $result = $TestModel->JoinAsJoinB->save($data);
- $lastInsertId = $TestModel->JoinAsJoinB->getLastInsertID();
- $data['id'] = $lastInsertId;
- $this->assertEquals($result, array('JoinAsJoinB' => $data));
- $this->assertTrue($lastInsertId != null);
-
- $result = $TestModel->JoinAsJoinB->findById(1);
- $expected = array(
- 'JoinAsJoinB' => array(
- 'id' => 1,
- 'join_a_id' => 1,
- 'join_b_id' => 2,
- 'other' => 'Data for Join A 1 Join B 2',
- 'created' => '2008-01-03 10:56:33',
- 'updated' => '2008-01-03 10:56:33'
- ));
- $this->assertEquals($expected, $result);
+ 'join_b_id' => 2,
+ 'other' => 'Data for Join A 1 Join B 2',
+ 'created' => '2008-01-03 10:56:33',
+ 'updated' => '2008-01-03 10:56:33'
+ ));
+ $this->assertEquals($expected, $result);
- $updatedValue = 'UPDATED Data for Join A 1 Join B 2';
- $TestModel->JoinAsJoinB->id = 1;
- $result = $TestModel->JoinAsJoinB->saveField('other', $updatedValue, false);
- $this->assertFalse(empty($result));
+ $TestModel->JoinAsJoinB->create();
+ $data = array(
+ 'join_a_id' => 1,
+ 'join_b_id' => 1,
+ 'other' => 'Data for Join A 1 Join B 1',
+ 'created' => '2008-01-03 10:56:44',
+ 'updated' => '2008-01-03 10:56:44'
+ );
+ $result = $TestModel->JoinAsJoinB->save($data);
+ $lastInsertId = $TestModel->JoinAsJoinB->getLastInsertID();
+ $data['id'] = $lastInsertId;
+ $this->assertEquals($result, array('JoinAsJoinB' => $data));
+ $this->assertTrue($lastInsertId != null);
- $result = $TestModel->JoinAsJoinB->findById(1);
- $this->assertEquals($result['JoinAsJoinB']['other'], $updatedValue);
- }
+ $result = $TestModel->JoinAsJoinB->findById(1);
+ $expected = array(
+ 'JoinAsJoinB' => array(
+ 'id' => 1,
+ 'join_a_id' => 1,
+ 'join_b_id' => 2,
+ 'other' => 'Data for Join A 1 Join B 2',
+ 'created' => '2008-01-03 10:56:33',
+ 'updated' => '2008-01-03 10:56:33'
+ ));
+ $this->assertEquals($expected, $result);
+
+ $updatedValue = 'UPDATED Data for Join A 1 Join B 2';
+ $TestModel->JoinAsJoinB->id = 1;
+ $result = $TestModel->JoinAsJoinB->saveField('other', $updatedValue, false);
+ $this->assertFalse(empty($result));
+
+ $result = $TestModel->JoinAsJoinB->findById(1);
+ $this->assertEquals($result['JoinAsJoinB']['other'], $updatedValue);
+ }
/**
* testSaveDateAsFirstEntry method

0 comments on commit b8e27c7

Please sign in to comment.
Something went wrong with that request. Please try again.