public function testStoringDocuments() { if (!is_dir('/tmp/flywheel')) { mkdir('/tmp/flywheel'); } $config = new Config('/tmp/flywheel'); $repo = new Repository('_pages', $config); for ($i = 0; $i < 5; $i++) { $data = array('id' => $i, 'slug' => '123', 'body' => 'THIS IS BODY TEXT'); $document = new Document($data); $repo->store($document); $name = $i . '_' . sha1($i) . '.json'; $this->assertSame($data, (array) json_decode(file_get_contents('/tmp/flywheel/_pages/' . $name))); } }
/** * Store Project * * Create new project entry * * @returns Illuminate response (JSON & HTTP code) */ public function store(Request $request) { return $this->pageRepository->store(new Page(), $request); }
/** * Store Tag * * Create new project entry * * @returns Illuminate response (JSON & HTTP code) */ public function store(Request $request) { return $this->tagRepository->store(new Tag(), $request); }
/** * Store Project * * Create new project entry * * @returns Illuminate response (JSON & HTTP code) */ public function store(Request $request) { return $this->projectRepository->store(new Project(), $request); }
/** * Store Project * * Create new project entry * * @returns Illuminate response (JSON & HTTP code) */ public function store(Request $request) { return $this->restfulRepository->store(new Section(), $request); }