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:
19
tests/Foundation/Entries/Fields/UuidFieldTest.php
Normal file
19
tests/Foundation/Entries/Fields/UuidFieldTest.php
Normal 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));
|
||||
});
|
Reference in New Issue
Block a user