Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
Merge 900304c into 79955a3
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkGhostHunter committed Mar 5, 2020
2 parents 79955a3 + 900304c commit 3c75610
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"symfony/finder": "4.*|5.*"
},
"require-dev": {
"orchestra/testbench": "4.*|5.*"
"orchestra/testbench": "~4.1|5.*"
},
"autoload": {
"psr-4": {
Expand Down
12 changes: 6 additions & 6 deletions tests/Models/DynamicallyMutatesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public function __construct(array $attributes = [])

'date' => '2020-09-30',

'datetime' => '2020-09-30 14:52:53',
'custom_datetime' => '2020-09-31 14:52:53',
'datetime' => '2020-09-30 14:53:03',
'custom_datetime' => '2020-09-31 14:53:03',

'timestamp' => '2020-09-31 14:52:53',
'timestamp' => '2020-09-31 14:53:03',

'null' => null,

Expand Down Expand Up @@ -109,12 +109,12 @@ public function castTo($attribute) {
$this->assertEquals('2020-09-30', $model->castTo('date')->toDateString());

$this->assertInstanceOf(Carbon::class, $model->castTo('datetime'));
$this->assertEquals('2020-09-30 14:52:53', $model->castTo('datetime')->toDateTimeString());
$this->assertEquals('2020-09-30 14:53:03', $model->castTo('datetime')->toDateTimeString());
$this->assertInstanceOf(Carbon::class, $model->castTo('custom_datetime'));
$this->assertEquals('2020-10-01 14:52:53', $model->castTo('custom_datetime')->toDateTimeString());
$this->assertEquals('2020-10-01 14:53:03', $model->castTo('custom_datetime')->toDateTimeString());

$this->assertIsInt($model->castTo('timestamp'));
$this->assertEquals(1601563973, $model->castTo('timestamp'));
$this->assertEquals(1601563983, $model->castTo('timestamp'));

$this->assertNull($model->castTo('null'));

Expand Down
25 changes: 12 additions & 13 deletions tests/Models/HasSlugTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ public function testRoutesBySlug()
return $foo;
})->middleware('bindings');

if (Str::startsWith(Application::VERSION, '7.')) {
if (Str::startsWith(Application::VERSION, '7')) {
$this->get('foo/this-is-a-test')->assertExactJson([
'id' => 1,
'name' => $fooName,
'slug' => Str::slug($fooName),
'created_at' => $now->toIso8601ZuluString('microsecond'),
'updated_at' => $now->toIso8601ZuluString('microsecond'),
'id' => 1,
'name' => $fooName,
'slug' => Str::slug($fooName),
'created_at' => $now->toIso8601ZuluString('microseconds'),
'updated_at' => $now->toIso8601ZuluString('microseconds'),
]);
} else {
$this->get('foo/this-is-a-test')->assertExactJson([
'id' => 1,
'name' => $fooName,
'slug' => Str::slug($fooName),
'id' => 1,
'name' => $fooName,
'slug' => Str::slug($fooName),
'created_at' => $now->toDateTimeString(),
'updated_at' => $now->toDateTimeString(),
]);
Expand All @@ -85,14 +85,13 @@ public function testRoutesByPersonalizedSlug()
return $bar;
})->middleware('bindings');


if (Str::startsWith(Application::VERSION, '7.')) {
if (Str::startsWith(Application::VERSION, '7')) {
$this->get('bar/what-happened')->assertExactJson([
'id' => 1,
'quz' => $barName,
'qux' => Str::slug($barName),
'created_at' => $now->toIso8601ZuluString('microsecond'),
'updated_at' => $now->toIso8601ZuluString('microsecond'),
'created_at' => $now->toIso8601ZuluString('microseconds'),
'updated_at' => $now->toIso8601ZuluString('microseconds'),
]);
} else {
$this->get('bar/what-happened')->assertExactJson([
Expand Down

0 comments on commit 3c75610

Please sign in to comment.