Code Duplication    Length = 6-9 lines in 5 locations

tests/model/DbDatetimeTest.php 1 location

@@ 64-70 (lines=7) @@
61
		$this->assertEquals('1970-01-01 00:00:00', $date->getValue(), 'Numeric zero is UNIX epoch time');
62
	}
63
64
	public function testExtendedDateTimes() {
65
		$date = DBField::create_field('Datetime', '1500-10-10 15:32:24');
66
		$this->assertEquals('10 Oct 1500 15 32 24', $date->Format('d M Y H i s'));
67
68
		$date = DBField::create_field('Datetime', '3000-10-10 15:32:24');
69
		$this->assertEquals('10 Oct 3000 15 32 24', $date->Format('d M Y H i s'));
70
	}
71
72
	public function testNice() {
73
		$date = DBField::create_field('Datetime', '2001-12-31 22:10:59');

tests/model/DBHTMLTextTest.php 4 locations

@@ 338-344 (lines=7) @@
335
		$this->assertEquals($expectedValue, $result);
336
	}
337
338
	public function testRAW() {
339
		$data = DBField::create_field('HTMLFragment', 'This & This');
340
		$this->assertEquals('This & This', $data->RAW());
341
342
		$data = DBField::create_field('HTMLFragment', 'This & This');
343
		$this->assertEquals('This & This', $data->RAW());
344
	}
345
346
	public function testXML() {
347
		$data = DBField::create_field('HTMLFragment', 'This & This');
@@ 346-351 (lines=6) @@
343
		$this->assertEquals('This & This', $data->RAW());
344
	}
345
346
	public function testXML() {
347
		$data = DBField::create_field('HTMLFragment', 'This & This');
348
		$this->assertEquals('This & This', $data->XML());
349
		$data = DBField::create_field('HTMLFragment', 'This & This');
350
		$this->assertEquals('This & This', $data->XML());
351
	}
352
353
	public function testHTML() {
354
		$data = DBField::create_field('HTMLFragment', 'This & This');
@@ 353-358 (lines=6) @@
350
		$this->assertEquals('This & This', $data->XML());
351
	}
352
353
	public function testHTML() {
354
		$data = DBField::create_field('HTMLFragment', 'This & This');
355
		$this->assertEquals('This & This', $data->HTML());
356
		$data = DBField::create_field('HTMLFragment', 'This & This');
357
		$this->assertEquals('This & This', $data->HTML());
358
	}
359
360
	public function testJS() {
361
		$data = DBField::create_field('HTMLText', '"this is & test"');
@@ 365-373 (lines=9) @@
362
		$this->assertEquals('\"this is \x26amp; test\"', $data->JS());
363
	}
364
365
	public function testATT() {
366
		// HTML Fragment
367
		$data = DBField::create_field('HTMLFragment', '"this is a test"');
368
		$this->assertEquals('"this is a test"', $data->ATT());
369
370
		// HTML Text (passes shortcodes + tidy)
371
		$data = DBField::create_field('HTMLText', '"');
372
		$this->assertEquals('"', $data->ATT());
373
	}
374
375
	public function testShortcodesProcessed()
376
	{