1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-07 21:56:33 +02:00

feat(tests): improve tests

This commit is contained in:
Awilum
2021-09-28 22:28:34 +03:00
parent 537f9324b8
commit b81a9ff4b7
2 changed files with 6 additions and 0 deletions

View File

@@ -4,6 +4,9 @@ declare(strict_types=1);
test('encode', function () {
$this->assertEquals(65, strings(serializers()->phparray()->encode(['title' => 'Foo', 'content' => 'Bar']))->length());
registry()->set('flextype.settings.serializers.phparray.encode.wrap', false);
$this->assertEquals(49, strings(serializers()->phparray()->encode(['title' => 'Foo', 'content' => 'Bar']))->length());
});
test('decode', function () {

View File

@@ -4,6 +4,9 @@ declare(strict_types=1);
test('encode', function () {
$this->assertEquals(31, strings(serializers()->phpcode()->encode(['flextype' => registry()->get("flextype.manifest.version")]))->length());
registry()->set('flextype.settings.serializers.phpcode.encode.wrap', true);
$this->assertEquals(47, strings(serializers()->phpcode()->encode(['flextype' => registry()->get("flextype.manifest.version")]))->length());
});
test('decode', function () {