Code Duplication    Length = 12-12 lines in 3 locations

lib/Cake/Test/Case/Model/ModelWriteTest.php 3 locations

@@ 4894-4905 (lines=12) @@
4891
 * @link https://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data
4892
 * @return void
4893
 */
4894
	public function testSaveAllEmptyData() {
4895
		$this->skipIf($this->db instanceof Sqlserver, 'This test is not compatible with SQL Server.');
4896
4897
		$this->loadFixtures('Article', 'ProductUpdateAll', 'Comment', 'Attachment');
4898
		$model = new Article();
4899
		$result = $model->saveAll(array(), array('validate' => 'first'));
4900
		$this->assertFalse(empty($result));
4901
4902
		$model = new ProductUpdateAll();
4903
		$result = $model->saveAll();
4904
		$this->assertFalse($result);
4905
	}
4906
4907
/**
4908
 * testSaveAssociated method
@@ 6287-6298 (lines=12) @@
6284
 * @link https://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data
6285
 * @return void
6286
 */
6287
	public function testSaveManyEmptyData() {
6288
		$this->skipIf($this->db instanceof Sqlserver, 'This test is not compatible with SQL Server.');
6289
6290
		$this->loadFixtures('Article', 'ProductUpdateAll', 'Comment', 'Attachment');
6291
		$model = new Article();
6292
		$result = $model->saveMany(array(), array('validate' => true));
6293
		$this->assertFalse(empty($result));
6294
6295
		$model = new ProductUpdateAll();
6296
		$result = $model->saveMany(array());
6297
		$this->assertFalse($result);
6298
	}
6299
6300
/**
6301
 * test that saveAssociated behaves like plain save() when supplied empty data
@@ 6306-6317 (lines=12) @@
6303
 * @link https://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data
6304
 * @return void
6305
 */
6306
	public function testSaveAssociatedEmptyData() {
6307
		$this->skipIf($this->db instanceof Sqlserver, 'This test is not compatible with SQL Server.');
6308
6309
		$this->loadFixtures('Article', 'ProductUpdateAll', 'Comment', 'Attachment');
6310
		$model = new Article();
6311
		$result = $model->saveAssociated(array(), array('validate' => true));
6312
		$this->assertFalse(empty($result));
6313
6314
		$model = new ProductUpdateAll();
6315
		$result = $model->saveAssociated(array());
6316
		$this->assertFalse($result);
6317
	}
6318
6319
/**
6320
 * Test that saveAssociated will accept expression object values when saving.