Exemple #1
0
         $parent = Stub::create();
         $collection = new Collection();
         $collection->parent($parent);
         expect($collection->parent())->toBe($parent);
     });
 });
 describe("->rootPath()", function () {
     it("returns the root path", function () {
         $collection = new Collection(['rootPath' => 'items']);
         expect($collection->rootPath())->toBe('items');
     });
 });
 describe("->model()", function () {
     it("returns the model", function () {
         $collection = new Collection(['model' => Model::class]);
         expect($collection->model())->toBe(Model::class);
     });
 });
 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]);
     });
 });
 describe("->invoke()", function () {
     beforeEach(function () {
         $this->collection = new Collection();
         $class = Stub::classname();
         Stub::on($class)->method('hello', function () {
             return 'world';
         });