@@ -9,26 +9,26 @@ discard block |
||
| 9 | 9 | public function index(Request $request) |
| 10 | 10 | { |
| 11 | 11 | return response()->json($this->mainService |
| 12 | - ->findAll($this->translateFilters($request)) |
|
| 13 | - ->toArray()); |
|
| 12 | + ->findAll($this->translateFilters($request)) |
|
| 13 | + ->toArray()); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function show($id) |
| 17 | 17 | { |
| 18 | 18 | return response()->json($this->mainService |
| 19 | - ->find($id)->toArray()); |
|
| 19 | + ->find($id)->toArray()); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public function store(Request $request) |
| 23 | 23 | { |
| 24 | 24 | $entity = $this->mainService |
| 25 | - ->store($this->filterRequest($request->json() |
|
| 25 | + ->store($this->filterRequest($request->json() |
|
| 26 | 26 | ->all(), |
| 27 | 27 | $this->mainService |
| 28 | - ->getMainRepository() |
|
| 29 | - ->createEntity() |
|
| 30 | - ->getOnlyStore())) |
|
| 31 | - ->flush(); |
|
| 28 | + ->getMainRepository() |
|
| 29 | + ->createEntity() |
|
| 30 | + ->getOnlyStore())) |
|
| 31 | + ->flush(); |
|
| 32 | 32 | |
| 33 | 33 | return response()->json($entity->toArray()); |
| 34 | 34 | } |
@@ -36,13 +36,13 @@ discard block |
||
| 36 | 36 | public function update(Request $request, $id) |
| 37 | 37 | { |
| 38 | 38 | $entity = $this->mainService |
| 39 | - ->update($id, $this->filterRequest($request->json() |
|
| 40 | - ->all(), |
|
| 41 | - $this->mainService |
|
| 42 | - ->getMainRepository() |
|
| 43 | - ->createEntity() |
|
| 44 | - ->getOnlyUpdate())) |
|
| 45 | - ->flush(); |
|
| 39 | + ->update($id, $this->filterRequest($request->json() |
|
| 40 | + ->all(), |
|
| 41 | + $this->mainService |
|
| 42 | + ->getMainRepository() |
|
| 43 | + ->createEntity() |
|
| 44 | + ->getOnlyUpdate())) |
|
| 45 | + ->flush(); |
|
| 46 | 46 | |
| 47 | 47 | return response()->json($entity->toArray()); |
| 48 | 48 | } |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | public function destroy($id) |
| 51 | 51 | { |
| 52 | 52 | $entity = $this->mainService |
| 53 | - ->remove($id) |
|
| 54 | - ->flush(); |
|
| 53 | + ->remove($id) |
|
| 54 | + ->flush(); |
|
| 55 | 55 | |
| 56 | 56 | return response()->json($entity->toArray()); |
| 57 | 57 | } |
@@ -28,12 +28,12 @@ |
||
| 28 | 28 | $this->builder = new Builder(); |
| 29 | 29 | |
| 30 | 30 | $this->builder |
| 31 | - ->setIssuer(gethostname()) |
|
| 32 | - ->setId(time(), true); |
|
| 33 | - // ->setIssuedAt(time()) |
|
| 34 | - // ->setNotBefore(time() + 60) |
|
| 35 | - // ->setExpiration(time() + 3600) |
|
| 36 | - // ->set('teste', 1); |
|
| 31 | + ->setIssuer(gethostname()) |
|
| 32 | + ->setId(time(), true); |
|
| 33 | + // ->setIssuedAt(time()) |
|
| 34 | + // ->setNotBefore(time() + 60) |
|
| 35 | + // ->setExpiration(time() + 3600) |
|
| 36 | + // ->set('teste', 1); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | public function testStore() |
| 35 | 35 | { |
| 36 | 36 | $response = $this->curlHelper |
| 37 | - ->post( |
|
| 37 | + ->post( |
|
| 38 | 38 | $this->getServiceTest()->getRepositoryTest()->getMockArray() |
| 39 | - ) |
|
| 40 | - ->send() |
|
| 41 | - ->getResponse(); |
|
| 39 | + ) |
|
| 40 | + ->send() |
|
| 41 | + ->getResponse(); |
|
| 42 | 42 | |
| 43 | 43 | $this->assertEquals(200, $response['code']); |
| 44 | 44 | |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $response = $this->curlHelper |
| 64 | - ->setPosFixUrl('/'.$flushedMockArray['id']) |
|
| 65 | - ->put($flushedMockArray) |
|
| 66 | - ->send() |
|
| 67 | - ->getResponse(); |
|
| 64 | + ->setPosFixUrl('/'.$flushedMockArray['id']) |
|
| 65 | + ->put($flushedMockArray) |
|
| 66 | + ->send() |
|
| 67 | + ->getResponse(); |
|
| 68 | 68 | |
| 69 | 69 | $this->assertEquals(200, $response['code']); |
| 70 | 70 | |
@@ -80,10 +80,10 @@ discard block |
||
| 80 | 80 | $entity = $this->getServiceTest()->getRepositoryTest()->getFlushedMockObject(); |
| 81 | 81 | |
| 82 | 82 | $response = $this->curlHelper |
| 83 | - ->setPosFixUrl('/'.$entity->getId()) |
|
| 84 | - ->delete() |
|
| 85 | - ->send() |
|
| 86 | - ->getResponse(); |
|
| 83 | + ->setPosFixUrl('/'.$entity->getId()) |
|
| 84 | + ->delete() |
|
| 85 | + ->send() |
|
| 86 | + ->getResponse(); |
|
| 87 | 87 | |
| 88 | 88 | $this->assertEquals(200, $response['code']); |
| 89 | 89 | |
@@ -7,8 +7,8 @@ discard block |
||
| 7 | 7 | public function testFindAll() |
| 8 | 8 | { |
| 9 | 9 | $entity = $this->getService() |
| 10 | - ->store($this->getRepositoryTest()->getMockArray()) |
|
| 11 | - ->flush(); |
|
| 10 | + ->store($this->getRepositoryTest()->getMockArray()) |
|
| 11 | + ->flush(); |
|
| 12 | 12 | |
| 13 | 13 | $findAll = $this->getService()->findAll()->getResult(); |
| 14 | 14 | |
@@ -19,11 +19,11 @@ discard block |
||
| 19 | 19 | public function testStore() |
| 20 | 20 | { |
| 21 | 21 | $entity = $this->getService() |
| 22 | - ->store($this->getRepositoryTest()->getMockArray()) |
|
| 23 | - ->flush(); |
|
| 22 | + ->store($this->getRepositoryTest()->getMockArray()) |
|
| 23 | + ->flush(); |
|
| 24 | 24 | |
| 25 | 25 | $repository = $this->getService() |
| 26 | - ->getMainRepository(); |
|
| 26 | + ->getMainRepository(); |
|
| 27 | 27 | |
| 28 | 28 | $find = $repository->find($entity->getId()); |
| 29 | 29 | |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $entity = $this->getService() |
| 48 | - ->update($flushedMockArray['id'], $flushedMockArray) |
|
| 49 | - ->flush(); |
|
| 48 | + ->update($flushedMockArray['id'], $flushedMockArray) |
|
| 49 | + ->flush(); |
|
| 50 | 50 | |
| 51 | 51 | $repository = $this->getService()->getMainRepository(); |
| 52 | 52 | |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | public function testRemove() |
| 64 | 64 | { |
| 65 | 65 | $entity = $this->getService() |
| 66 | - ->store($this->getRepositoryTest()->getMockArray()) |
|
| 67 | - ->flush(); |
|
| 66 | + ->store($this->getRepositoryTest()->getMockArray()) |
|
| 67 | + ->flush(); |
|
| 68 | 68 | |
| 69 | 69 | $this->getService() |
| 70 | - ->remove($entity->getId()) |
|
| 71 | - ->flush(); |
|
| 70 | + ->remove($entity->getId()) |
|
| 71 | + ->flush(); |
|
| 72 | 72 | |
| 73 | 73 | $find = $this->getService()->getMainRepository()->find($entity->getId()); |
| 74 | 74 | } |
@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | $entity = $this->getMockObject($except); |
| 16 | 16 | |
| 17 | 17 | $this->getRepository() |
| 18 | - ->save($entity) |
|
| 19 | - ->flush($entity); |
|
| 18 | + ->save($entity) |
|
| 19 | + ->flush($entity); |
|
| 20 | 20 | |
| 21 | 21 | return $entity; |
| 22 | 22 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $entity = $this->getFlushedMockObject(); |
| 88 | 88 | |
| 89 | 89 | $repository->remove($entity) |
| 90 | - ->flush($entity); |
|
| 90 | + ->flush($entity); |
|
| 91 | 91 | |
| 92 | 92 | $repository->find($entity->getId()); |
| 93 | 93 | } |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | public function prePersist() |
| 83 | 83 | { |
| 84 | 84 | $this->getRepository() |
| 85 | - ->preSave($this) |
|
| 86 | - ->validate($this); |
|
| 85 | + ->preSave($this) |
|
| 86 | + ->validate($this); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | public function preUpdate() |
| 93 | 93 | { |
| 94 | 94 | $this->getRepository() |
| 95 | - ->preSave($this) |
|
| 96 | - ->validate($this); |
|
| 95 | + ->preSave($this) |
|
| 96 | + ->validate($this); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | public function getRepository() |