Code Duplication    Length = 18-18 lines in 2 locations

tests/Query/MySQLQueryTest.php 1 location

@@ 17-34 (lines=18) @@
14
15
use chillerlan\Database\Drivers\MySQLiDriver;
16
17
class MySQLQueryTest extends QueryTestAbstract{
18
19
	protected $driver = MySQLiDriver::class;
20
	protected $envVar = 'DB_MYSQLI_';
21
22
	public function testCreateDatabase(){
23
		$this->assertSame(
24
			'CREATE DATABASE `vagrant` CHARACTER SET utf8',
25
			$this->createDatabase()->sql()
26
		);
27
28
		$this->assertSame(
29
			'CREATE DATABASE IF NOT EXISTS `vagrant` CHARACTER SET utf8mb4 COLLATE utf8mb4_bin',
30
			$this->createDatabase()->charset('utf8mb4_bin')->ifNotExists()->sql()
31
		);
32
	}
33
34
}
35

tests/Query/PostgresQueryTest.php 1 location

@@ 18-35 (lines=18) @@
15
use chillerlan\Database\Drivers\PDO\PDOPostgresDriver;
16
use chillerlan\Database\Drivers\PostgreSQLDriver;
17
18
class PostgresQueryTest extends QueryTestAbstract{
19
20
	protected $driver = PDOPostgresDriver::class;
21
	protected $envVar = 'DB_POSTGRES_';
22
23
	public function testCreateDatabase(){
24
		$this->assertSame(
25
			'CREATE DATABASE "vagrant" ENCODING \'UTF8\'',
26
			$this->createDatabase()->sql()
27
		);
28
29
		$this->assertSame(
30
			'CREATE DATABASE "vagrant" ENCODING \'EUC_KR\' LC_COLLATE=\'ko_KR.euckr\' LC_CTYPE=\'ko_KR.euckr\'',
31
			$this->createDatabase()->charset('EUC_KR,ko_KR.euckr,ko_KR.euckr')->sql()
32
		);
33
	}
34
35
}
36