1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-08 14:16:46 +02:00

feat(tests): add tests for entry UuidField #477

This commit is contained in:
Awilum
2020-10-18 14:40:56 +03:00
parent b82bc6314e
commit f8b456b05b

View File

@@ -0,0 +1,19 @@
<?php
use Flextype\Component\Filesystem\Filesystem;
use Respect\Validation\Validator as v;
beforeEach(function() {
filesystem()->directory(PATH['project'] . '/entries')->create();
});
afterEach(function (): void {
filesystem()->directory(PATH['project'] . '/entries')->delete();
});
test('test UuidField', function () {
flextype('entries')->create('foo', []);
$uuid = flextype('entries')->fetch('foo')['uuid'];
$this->assertTrue(v::uuid()->validate($uuid));
});