@@ -32,8 +32,10 @@ public function itResolvesAuditData()
32
32
'published_at ' => $ now ,
33
33
]);
34
34
35
- /** @var Audit $audit */
36
35
$ audit = $ article ->audits ()->first ();
36
+
37
+ $ this ->assertNotNull ($ audit );
38
+
37
39
$ resolvedData = $ audit ->resolveData ();
38
40
$ this ->assertCount (15 , $ resolvedData );
39
41
@@ -83,6 +85,8 @@ public function itResolvesAuditDataIncludingUserAttributes()
83
85
84
86
$ audit = $ article ->audits ()->first ();
85
87
88
+ $ this ->assertNotNull ($ audit );
89
+
86
90
$ this ->assertCount (21 , $ resolvedData = $ audit ->resolveData ());
87
91
88
92
Assert::assertArraySubset ([
@@ -132,6 +136,8 @@ public function itReturnsTheAppropriateAuditableDataValues()
132
136
'published_at ' => Carbon::now (),
133
137
])->audits ()->first ();
134
138
139
+ $ this ->assertNotNull ($ audit );
140
+
135
141
// Resolve data, making it available to the getDataValue() method
136
142
$ this ->assertCount (21 , $ audit ->resolveData ());
137
143
@@ -198,6 +204,8 @@ public function itReturnsAuditMetadataAsArray()
198
204
{
199
205
$ audit = Article::factory ()->create ()->audits ()->first ();
200
206
207
+ $ this ->assertNotNull ($ audit );
208
+
201
209
$ this ->assertCount (10 , $ metadata = $ audit ->getMetadata ());
202
210
203
211
Assert::assertArraySubset ([
@@ -225,6 +233,8 @@ public function itReturnsProperCommandLineInUrlAuditMetadata()
225
233
{
226
234
$ audit = factory (Article::class)->create ()->audits ()->first ();
227
235
236
+ $ this ->assertNotNull ($ audit );
237
+
228
238
self ::Assert ()::assertEquals ($ audit ->getMetadata ()['audit_url ' ], 'vendor/bin/phpunit tests/Unit/AuditTest.php --group command-line-url-resolver ' );
229
239
}
230
240
@@ -244,9 +254,10 @@ public function itReturnsAuditMetadataIncludingUserAttributesAsArray()
244
254
245
255
$ this ->actingAs ($ user );
246
256
247
- /** @var Audit $audit */
248
257
$ audit = Article::factory ()->create ()->audits ()->first ();
249
258
259
+ $ this ->assertNotNull ($ audit );
260
+
250
261
$ this ->assertCount (16 , $ metadata = $ audit ->getMetadata ());
251
262
252
263
Assert::assertArraySubset ([
@@ -278,6 +289,8 @@ public function itReturnsAuditMetadataAsJsonString()
278
289
{
279
290
$ audit = Article::factory ()->create ()->audits ()->first ();
280
291
292
+ $ this ->assertNotNull ($ audit );
293
+
281
294
$ metadata = $ audit ->getMetadata (true , JSON_PRETTY_PRINT );
282
295
283
296
$ created_at = $ audit ->getSerializedDate ($ audit ->created_at );
@@ -316,6 +329,8 @@ public function itReturnsAuditMetadataIncludingUserAttributesAsJsonString()
316
329
317
330
$ audit = Article::factory ()->create ()->audits ()->first ();
318
331
332
+ $ this ->assertNotNull ($ audit );
333
+
319
334
$ metadata = $ audit ->getMetadata (true , JSON_PRETTY_PRINT );
320
335
321
336
$ created_at = $ audit ->getSerializedDate ($ audit ->created_at );
@@ -360,6 +375,8 @@ public function itReturnsAuditableModifiedAttributesAsArray()
360
375
'published_at ' => $ now ,
361
376
])->audits ()->first ();
362
377
378
+ $ this ->assertNotNull ($ audit );
379
+
363
380
$ this ->assertCount (5 , $ modified = $ audit ->getModified ());
364
381
365
382
Assert::assertArraySubset ([
@@ -390,14 +407,15 @@ public function itReturnsAuditableModifiedAttributesAsJsonString()
390
407
{
391
408
$ now = Carbon::now ()->second (0 )->microsecond (0 );
392
409
393
- /** @var Audit $audit */
394
410
$ audit = Article::factory ()->create ([
395
411
'title ' => 'How To Audit Eloquent Models ' ,
396
412
'content ' => 'First step: install the laravel-auditing package. ' ,
397
413
'reviewed ' => 1 ,
398
414
'published_at ' => $ now ,
399
415
])->audits ()->first ();
400
416
417
+ $ this ->assertNotNull ($ audit );
418
+
401
419
$ modified = $ audit ->getModified (true , JSON_PRETTY_PRINT );
402
420
403
421
$ serializedDate = $ audit ->getSerializedDate ($ now );
0 commit comments