@@ -6,8 +6,7 @@ |
||
6 | 6 | * @Annotation |
7 | 7 | * @Target({"PROPERTY"}) |
8 | 8 | */ |
9 | -class Rule |
|
10 | -{ |
|
9 | +class Rule { |
|
11 | 10 | /** |
12 | 11 | * @Enum({"STORE", "UPDATE", "*"}) |
13 | 12 | */ |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Foundation\Testing\TestCase as BaseTestCase; |
6 | 6 | |
7 | -abstract class TestCase extends BaseTestCase |
|
8 | -{ |
|
7 | +abstract class TestCase extends BaseTestCase { |
|
9 | 8 | use CreatesApplication; |
10 | 9 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | * |
15 | 15 | * @return \Illuminate\Foundation\Application |
16 | 16 | */ |
17 | - public function createApplication() |
|
17 | + public function createApplication () |
|
18 | 18 | { |
19 | 19 | $app = require __DIR__.'/../bootstrap/app.php'; |
20 | 20 |
@@ -5,8 +5,7 @@ |
||
5 | 5 | use Faker\Factory; |
6 | 6 | use Illuminate\Contracts\Console\Kernel; |
7 | 7 | |
8 | -trait CreatesApplication |
|
9 | -{ |
|
8 | +trait CreatesApplication { |
|
10 | 9 | protected $faker; |
11 | 10 | |
12 | 11 | /** |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * |
13 | 13 | * @return void |
14 | 14 | */ |
15 | - public function testBasicTest() |
|
15 | + public function testBasicTest () |
|
16 | 16 | { |
17 | 17 | $this->assertTrue(true); |
18 | 18 | } |
@@ -14,6 +14,6 @@ |
||
14 | 14 | */ |
15 | 15 | public function testBasicTest() |
16 | 16 | { |
17 | - $this->assertTrue(true); |
|
17 | + $this->assertTrue(TRUE); |
|
18 | 18 | } |
19 | 19 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Tests\TestCase; |
6 | 6 | |
7 | -class ExampleTest extends TestCase |
|
8 | -{ |
|
7 | +class ExampleTest extends TestCase { |
|
9 | 8 | /** |
10 | 9 | * A basic test example. |
11 | 10 | * |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | $entity = $this->getFlushedMockObject(); |
69 | 69 | |
70 | 70 | $result = $this->getRepository() |
71 | - ->findAll() |
|
72 | - ->getResult(); |
|
71 | + ->findAll() |
|
72 | + ->getResult(); |
|
73 | 73 | |
74 | 74 | $this->assertGreaterThan(0, $result->count()); |
75 | 75 | $this->assertInstanceOf($this->getRepository()->getClassName(), $result[0]); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $entity = $this->getFlushedMockObject(); |
93 | 93 | |
94 | 94 | $result = $this->getRepository() |
95 | - ->findOneBy(['id' => $entity->getId()]); |
|
95 | + ->findOneBy(['id' => $entity->getId()]); |
|
96 | 96 | |
97 | 97 | $this->assertNotNull($result); |
98 | 98 | $this->assertInstanceOf($this->getRepository()->getClassName(), $result); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $entity = $this->getFlushedMockObject(); |
105 | 105 | |
106 | 106 | $result = $this->getRepository() |
107 | - ->find($entity->getId()); |
|
107 | + ->find($entity->getId()); |
|
108 | 108 | |
109 | 109 | $this->assertNotNull($result); |
110 | 110 | $this->assertInstanceOf($this->getRepository()->getClassName(), $result); |
@@ -114,12 +114,12 @@ discard block |
||
114 | 114 | public function testFindAllRemoved() |
115 | 115 | { |
116 | 116 | $entity = $this->getFlushedMockObject() |
117 | - ->remove() |
|
118 | - ->flush(); |
|
117 | + ->remove() |
|
118 | + ->flush(); |
|
119 | 119 | |
120 | 120 | $result = $this->getRepository() |
121 | - ->findAllRemoved() |
|
122 | - ->getResult(); |
|
121 | + ->findAllRemoved() |
|
122 | + ->getResult(); |
|
123 | 123 | |
124 | 124 | $this->assertGreaterThan(0, $result->count()); |
125 | 125 | $this->assertInstanceOf($this->getRepository()->getClassName(), $result[0]); |
@@ -140,11 +140,11 @@ discard block |
||
140 | 140 | public function testFindRemoved() |
141 | 141 | { |
142 | 142 | $entity = $this->getFlushedMockObject() |
143 | - ->remove() |
|
144 | - ->flush(); |
|
143 | + ->remove() |
|
144 | + ->flush(); |
|
145 | 145 | |
146 | 146 | $result = $this->getRepository() |
147 | - ->findRemoved($entity->getId()); |
|
147 | + ->findRemoved($entity->getId()); |
|
148 | 148 | |
149 | 149 | $this->assertNotNull($result); |
150 | 150 | $this->assertInstanceOf($this->getRepository()->getClassName(), $result); |
@@ -162,16 +162,16 @@ discard block |
||
162 | 162 | $entity = $this->getFlushedMockObject(); |
163 | 163 | |
164 | 164 | $this->getRepository() |
165 | - ->remove($entity) |
|
166 | - ->flush(); |
|
165 | + ->remove($entity) |
|
166 | + ->flush(); |
|
167 | 167 | |
168 | 168 | $result = $this->getRepository() |
169 | - ->find($entity->getId(), false); |
|
169 | + ->find($entity->getId(), false); |
|
170 | 170 | |
171 | 171 | $this->assertNull($result); |
172 | 172 | |
173 | 173 | $result = $this->getRepository() |
174 | - ->findRemoved($entity->getId()); |
|
174 | + ->findRemoved($entity->getId()); |
|
175 | 175 | |
176 | 176 | $this->assertNotNull($result); |
177 | 177 | $this->assertInstanceOf($this->getRepository()->getClassName(), $result); |
@@ -166,7 +166,7 @@ |
||
166 | 166 | ->flush(); |
167 | 167 | |
168 | 168 | $result = $this->getRepository() |
169 | - ->find($entity->getId(), false); |
|
169 | + ->find($entity->getId(), FALSE); |
|
170 | 170 | |
171 | 171 | $this->assertNull($result); |
172 | 172 |
@@ -8,8 +8,7 @@ |
||
8 | 8 | use Doctrine\ORM\Mapping\ClassMetadata; |
9 | 9 | use Tests\TestCase; |
10 | 10 | |
11 | -class RotaRepositoryTest extends TestCase |
|
12 | -{ |
|
11 | +class RotaRepositoryTest extends TestCase { |
|
13 | 12 | public function getClassName() |
14 | 13 | { |
15 | 14 | return 'Rota'; |
@@ -10,17 +10,17 @@ discard block |
||
10 | 10 | |
11 | 11 | class RotaRepositoryTest extends TestCase |
12 | 12 | { |
13 | - public function getClassName() |
|
13 | + public function getClassName () |
|
14 | 14 | { |
15 | 15 | return 'Rota'; |
16 | 16 | } |
17 | 17 | |
18 | - public function getRepository() |
|
18 | + public function getRepository () |
|
19 | 19 | { |
20 | 20 | return bdRepository($this->getClassName()); |
21 | 21 | } |
22 | 22 | |
23 | - public function getMockObject(array $options = []) |
|
23 | + public function getMockObject (array $options = [ ]) |
|
24 | 24 | { |
25 | 25 | return $this->getRepository() |
26 | 26 | ->createEntity() |
@@ -28,41 +28,41 @@ discard block |
||
28 | 28 | ->setAlias($this->faker->uuid); |
29 | 29 | } |
30 | 30 | |
31 | - public function getFlushedMockObject(array $options = []) |
|
31 | + public function getFlushedMockObject (array $options = [ ]) |
|
32 | 32 | { |
33 | 33 | return $this->getMockObject($options) |
34 | 34 | ->persist() |
35 | 35 | ->flush(); |
36 | 36 | } |
37 | 37 | |
38 | - public function getMockArray(array $options = []) |
|
38 | + public function getMockArray (array $options = [ ]) |
|
39 | 39 | { |
40 | 40 | return $this->getMockObject($options) |
41 | 41 | ->toArray(); |
42 | 42 | } |
43 | 43 | |
44 | - public function getFlushedMockArray(array $options = []) |
|
44 | + public function getFlushedMockArray (array $options = [ ]) |
|
45 | 45 | { |
46 | 46 | return $this->getFlushedMockObject($options) |
47 | 47 | ->toArray(); |
48 | 48 | } |
49 | 49 | |
50 | - public function testGetEntityManager() |
|
50 | + public function testGetEntityManager () |
|
51 | 51 | { |
52 | 52 | $this->assertInstanceOf(EntityManager::class, $this->getRepository()->getEntityManager()); |
53 | 53 | } |
54 | 54 | |
55 | - public function testGetClassMetadata() |
|
55 | + public function testGetClassMetadata () |
|
56 | 56 | { |
57 | 57 | $this->assertInstanceOf(ClassMetadata::class, $this->getRepository()->getClassMetadata()); |
58 | 58 | } |
59 | 59 | |
60 | - public function testCreateQueryWorker() |
|
60 | + public function testCreateQueryWorker () |
|
61 | 61 | { |
62 | 62 | $this->assertInstanceOf(QueryWorker::class, $this->getRepository()->createQueryWorker()); |
63 | 63 | } |
64 | 64 | |
65 | - public function testFindAll() |
|
65 | + public function testFindAll () |
|
66 | 66 | { |
67 | 67 | $entity = $this->getFlushedMockObject(); |
68 | 68 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | ->getResult(); |
72 | 72 | |
73 | 73 | $this->assertGreaterThan(0, $result->count()); |
74 | - $this->assertInstanceOf($this->getRepository()->getClassName(), $result[0]); |
|
74 | + $this->assertInstanceOf($this->getRepository()->getClassName(), $result[ 0 ]); |
|
75 | 75 | |
76 | 76 | $filteredResultById = $result->filter(function ($element) use ($entity) { |
77 | 77 | return $element->getId() === $entity->getId(); |
@@ -86,19 +86,19 @@ discard block |
||
86 | 86 | $this->assertEquals(0, $filteredResultByDeletedAt->count()); |
87 | 87 | } |
88 | 88 | |
89 | - public function testFindOneBy() |
|
89 | + public function testFindOneBy () |
|
90 | 90 | { |
91 | 91 | $entity = $this->getFlushedMockObject(); |
92 | 92 | |
93 | 93 | $result = $this->getRepository() |
94 | - ->findOneBy(['id' => $entity->getId()]); |
|
94 | + ->findOneBy([ 'id' => $entity->getId() ]); |
|
95 | 95 | |
96 | 96 | $this->assertNotNull($result); |
97 | 97 | $this->assertInstanceOf($this->getRepository()->getClassName(), $result); |
98 | 98 | $this->assertEquals($entity->getId(), $result->getId()); |
99 | 99 | } |
100 | 100 | |
101 | - public function testFind() |
|
101 | + public function testFind () |
|
102 | 102 | { |
103 | 103 | $entity = $this->getFlushedMockObject(); |
104 | 104 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $this->assertEquals($entity->getId(), $result->getId()); |
111 | 111 | } |
112 | 112 | |
113 | - public function testFindAllRemoved() |
|
113 | + public function testFindAllRemoved () |
|
114 | 114 | { |
115 | 115 | $entity = $this->getFlushedMockObject() |
116 | 116 | ->remove() |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | ->getResult(); |
122 | 122 | |
123 | 123 | $this->assertGreaterThan(0, $result->count()); |
124 | - $this->assertInstanceOf($this->getRepository()->getClassName(), $result[0]); |
|
124 | + $this->assertInstanceOf($this->getRepository()->getClassName(), $result[ 0 ]); |
|
125 | 125 | |
126 | 126 | $filteredResultById = $result->filter(function ($element) use ($entity) { |
127 | 127 | return $element->getId() === $entity->getId(); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $this->assertEquals(0, $filteredResultByDeletedAt->count()); |
137 | 137 | } |
138 | 138 | |
139 | - public function testFindRemoved() |
|
139 | + public function testFindRemoved () |
|
140 | 140 | { |
141 | 141 | $entity = $this->getFlushedMockObject() |
142 | 142 | ->remove() |
@@ -151,12 +151,12 @@ discard block |
||
151 | 151 | $this->assertInstanceOf(DateTime::class, $result->getDeletedAt()); |
152 | 152 | } |
153 | 153 | |
154 | - public function testCreateEntity() |
|
154 | + public function testCreateEntity () |
|
155 | 155 | { |
156 | 156 | $this->assertInstanceOf($this->getRepository()->getClassName(), $this->getRepository()->createEntity()); |
157 | 157 | } |
158 | 158 | |
159 | - public function testRemove() |
|
159 | + public function testRemove () |
|
160 | 160 | { |
161 | 161 | $entity = $this->getFlushedMockObject(); |
162 | 162 |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * |
13 | 13 | * @return void |
14 | 14 | */ |
15 | - public function testBasicTest() |
|
15 | + public function testBasicTest () |
|
16 | 16 | { |
17 | 17 | $response = $this->get('/'); |
18 | 18 |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Tests\TestCase; |
6 | 6 | |
7 | -class ExampleTest extends TestCase |
|
8 | -{ |
|
7 | +class ExampleTest extends TestCase { |
|
9 | 8 | /** |
10 | 9 | * A basic test example. |
11 | 10 | * |