You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verifies `$datetime` is equal to `$now`, precise to the second. `$now` defaults to `Carbon::now()` which can be faked with the `freezeNow()`[testing helper](freeze-now).
Matches an argument _equals_`$collection`. When called without `$collection`, will match any argument of type `\Illuminate\Database\Eloquent\Collection`.
105
109
106
110
107
-
## Creation Methods
108
-
This package also provides methods for quickly creating common objects used within Laravel application to use when testing.
Creates an instance of the given [Form Request](https://laravel.com/docs/7.x/validation#form-request-validation) class with the given request data.
116
117
118
+
```php
119
+
freezeNow(bool $subseconds = false)
120
+
```
121
+
122
+
Similar to Laravel's `freezeTime()` helper, but defaults with second precision and returns the frozen time. You may pass `true` to freeze with sub-second precision.
123
+
124
+
117
125
## Support Policy
118
126
Starting with version 2, this package will only support the latest stable version of Laravel (currently Laravel 8). If you need to support older versions of Laravel, you may use version 1 or upgrade your application ([try using Shift](https://laravelshift.com)).
Copy file name to clipboardExpand all lines: src/Traits/AdditionalAssertions.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,7 @@ public function assertNow(CarbonInterface $datetime, ?CarbonInterface $now = nul
119
119
{
120
120
$now ??= Carbon::now();
121
121
122
-
PHPUnitAssert::assertTrue($datetime->equalTo($now), 'Failed asserting the date time ['.$datetime->toDateTimeString().'] is equal to now ['.$now->toDateTimeString().']');
122
+
PHPUnitAssert::assertTrue($datetime->equalTo($now), 'Failed asserting the date time ['.$datetime->toDateTimeString('microsecond').'] is equal to now ['.$now->toDateTimeString('microsecond').']');
0 commit comments