File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 3636 (new RecordMetric ($ data ))->handle ();
3737
3838 // Count may be 1 (SQLite dedupes by JSON string) or 2 (MySQL compares JSON differently).
39- $ count = Metric::where ('name ' , 'page_views_with_json ' )->count ();
40- expect ($ count )->toBeGreaterThanOrEqual (1 );
39+ expect (Metric::where ('name ' , 'page_views_with_json ' )->count ())->toBeGreaterThanOrEqual (1 );
4140
4241 $ metric = Metric::where ('name ' , 'page_views_with_json ' )->first ();
4342
4746 expect ($ metric ->payload )->toBe (['a ' => 1 , 'b ' => 'test ' ]);
4847
4948 // Total value across all matching records should equal 2 regardless of DB.
50- expect (Metric::where ('name ' , 'page_views_with_json ' )->sum ('value ' ))->toBe (2 );
49+ expect (Metric::where ('name ' , 'page_views_with_json ' )->sum ('value ' ))->toEqual (2 );
5150});
5251
5352it ('differentiates metrics by json payload content ' , function () {
6362 (new RecordMetric ($ data2 ))->handle ();
6463
6564 // Count may be 2 (SQLite) or more (MySQL) depending on JSON comparison behavior.
66- $ metricsCount = Metric::where ('name ' , 'page_views_by_source ' )->count ();
67- expect ($ metricsCount )->toBeGreaterThanOrEqual (2 );
65+ expect (Metric::where ('name ' , 'page_views_by_source ' )->count ())->toBeGreaterThanOrEqual (2 );
6866});
You can’t perform that action at this time.
0 commit comments