/** * @test */ public function itShouldUseCacheToPopulateFields() { $initCache = new FileStore(); $user = new User(); $initType = new EloquentType($user, 'user'); $initType->schemaFields(); $initCache->store('user', $initType->getFields()); $cache = $this->prophesize(FileStore::class); $this->app->instance(FileStore::class, $cache->reveal()); $cache->get('User')->willReturn(collect(['foo' => 'bar'])); $cache->store()->shouldNotBeCalled(); $eloquentType = new EloquentType($user, 'user'); $eloquentType->toType(); }
/** * Execute the console command. * * @return mixed */ public function handle() { $this->cache->flush(); app('graphql')->schema(); $this->info('Eloquent Types successfully cached.'); }