Code Duplication    Length = 14-14 lines in 2 locations

tests/model/DatabaseTest.php 1 location

@@ 53-66 (lines=14) @@
50
		$this->resetDBSchema(true);
51
	}
52
53
	public function testMySQLCreateTableOptions() {
54
		if(!(DB::get_conn() instanceof MySQLDatabase)) {
55
			$this->markTestSkipped('MySQL only');
56
		}
57
58
59
		$ret = DB::query(sprintf(
60
			'SHOW TABLE STATUS WHERE "Name" = \'%s\'',
61
			'DatabaseTest_MyObject'
62
		))->first();
63
		$this->assertEquals($ret['Engine'],'InnoDB',
64
			"MySQLDatabase tables can be changed to InnoDB through DataObject::\$create_table_options"
65
		);
66
	}
67
68
	function testIsSchemaUpdating() {
69
		$schema = DB::get_schema();

tests/model/DataObjectTest.php 1 location

@@ 248-261 (lines=14) @@
245
		$this->assertEquals('Phil', $comment->Name);
246
	}
247
248
	public function testGetCaseInsensitive() {
249
		// Test get_one() with bad case on the classname
250
		// Note: This will succeed only if the underlying DB server supports case-insensitive
251
		// table names (e.g. such as MySQL, but not SQLite3)
252
		if(!(DB::get_conn() instanceof MySQLDatabase)) {
253
			$this->markTestSkipped('MySQL only');
254
		}
255
256
		$subteam1 = DataObject::get_one('dataobjecttest_subteam', array(
257
			'"DataObjectTest_Team"."Title"' => 'Subteam 1'
258
		), true);
259
		$this->assertNotEmpty($subteam1);
260
		$this->assertEquals($subteam1->Title, "Subteam 1");
261
	}
262
263
	public function testGetSubclassFields() {
264
		/* Test that fields / has_one relations from the parent table and the subclass tables are extracted */