Completed
Push — master ( d508c6...ead087 )
by smiley
02:37
created

PostgresQueryTest::testCreateTable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
dl 7
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
/**
3
 * Class PostgresQueryTest
4
 *
5
 * @filesource   PostgresQueryTest.php
6
 * @created      12.06.2017
7
 * @package      chillerlan\DatabaseTest\Query
8
 * @author       Smiley <[email protected]>
9
 * @copyright    2017 Smiley
10
 * @license      MIT
11
 */
12
13
namespace chillerlan\DatabaseTest\Query;
14
15
use chillerlan\Database\Drivers\PDO\PDOPostgresDriver;
16
use chillerlan\Database\Drivers\PostgreSQLDriver;
17
18 View Code Duplication
class PostgresQueryTest extends QueryTestAbstract{
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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