mirror of
https://github.com/archtechx/tenancy.git
synced 2026-05-06 15:24:03 +00:00
use a different encoding than utf8 in tests, more robust assertions
Before we were really just testing utf8 twice. With this change tests start failing in a way that makes it seem like passing *just* ENCODING isn't sufficient - if the encoding differs from the server locale we may need to pass LC_COLLATE / LC_CTYPE or some other things?
This commit is contained in:
parent
e400b28daa
commit
c2c2ca2e6a
1 changed files with 8 additions and 3 deletions
|
|
@ -568,12 +568,17 @@ test('newly created postgres databases use the correct charset', function (strin
|
||||||
->selectOne('SELECT pg_encoding_to_char(encoding) AS encoding FROM pg_database WHERE datname = ?', [$databaseName])
|
->selectOne('SELECT pg_encoding_to_char(encoding) AS encoding FROM pg_database WHERE datname = ?', [$databaseName])
|
||||||
->encoding;
|
->encoding;
|
||||||
|
|
||||||
$expectedCharset = $charset !== null ? strtoupper($charset) : $serverCharset;
|
if ($charset) {
|
||||||
|
expect($dbCharset)->toBe(strtoupper($charset));
|
||||||
|
} else {
|
||||||
|
expect($dbCharset)->toBe($serverCharset);
|
||||||
|
|
||||||
expect($dbCharset)->toBe($expectedCharset);
|
// Server charset should be UTF8 by default
|
||||||
|
expect($dbCharset)->toBe('UTF8');
|
||||||
|
}
|
||||||
})->with([
|
})->with([
|
||||||
null,
|
null,
|
||||||
'utf8',
|
'latin1',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Datasets
|
// Datasets
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue