describe("->parents()", function () { it("gets the parents", function () { $parent = new Document(); $collection = new Collection(); $parent->value = $collection; expect($collection->parents()->has($parent))->toBe(true); 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); }); });