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

feat(core): add test for copy() and delete() methods #477

This commit is contained in:
Awilum
2020-10-17 12:07:30 +03:00
parent 6297ff9b99
commit 4bc476fb91

View File

@@ -53,3 +53,25 @@ test('test fetch collection entry', function () {
$fetch = flextype('entries')->fetchCollection('foo');
$this->assertTrue(count($fetch) > 0);
});
test('test copy entry', function () {
// 1
flextype('entries')->create('foo', []);
flextype('entries')->create('foo/bar', []);
flextype('entries')->create('foo/baz', []);
flextype('entries')->create('zed', []);
flextype('entries')->copy('foo', 'zed');
$this->assertTrue(flextype('entries')->has('zed'));
});
test('test delete entry', function () {
// 1
flextype('entries')->create('foo', []);
flextype('entries')->create('foo/bar', []);
flextype('entries')->create('foo/baz', []);
$this->assertTrue(flextype('entries')->delete('foo'));
$this->assertFalse(flextype('entries')->has('foo'));
});