Example #1
0
         expect($collection->parents()->get($parent))->toBe('value');
     });
 });
 describe("->removeParent()", function () {
     it("removes a parent", function () {
         $parent = new Document();
         $collection = new Collection();
         $parent->value = $collection;
         unset($parent->value);
         expect($collection->parents()->has($parent))->toBe(false);
     });
 });
 describe("->basePath()", function () {
     it("returns the root path", function () {
         $collection = new Collection(['basePath' => 'items']);
         expect($collection->basePath())->toBe('items');
     });
 });
 describe("->schema()", function () {
     it("returns the schema", function () {
         $schema = new Schema();
         $collection = new Collection(['schema' => $schema]);
         expect($collection->schema())->toBe($schema);
     });
 });
 describe("->meta()", function () {
     it("returns the meta attributes", function () {
         $collection = new Collection(['meta' => ['page' => 5, 'limit' => 10]]);
         expect($collection->meta())->toBe(['page' => 5, 'limit' => 10]);
     });
 });