Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
voidgraphics committed Mar 15, 2021
1 parent 7f8df08 commit d7c4a45
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/HasSlug.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function getTranslatedSlugRouteParameters(Route $route, $locale = null)
$parameters = $route->signatureParameters(UrlRoutable::class);

$parameter = array_reduce($parameters, function($carry, $parameter) {
if($carry || $parameter->getClass()->name !== get_class()) return $carry;
if($carry || $parameter->getType()->getName() !== get_class()) return $carry;
return $parameter;
});

Expand Down
2 changes: 0 additions & 2 deletions tests/SluggableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public function test_it_saves_translated_slugs()
]
]);

$this->assertSame('{"en":"my-test-title","fr":"mon-titre-test"}', $model->getAttributes()['slug']);
$this->assertSame('my-test-title', $model->slug);
$this->assertSame('mon-titre-test', $model->translate('slug', 'fr'));
}
Expand All @@ -48,7 +47,6 @@ public function test_it_only_generates_missing_translated_slugs()
]
]);

$this->assertSame('{"en":"my-test-title","fr":"custom-french-slug"}', $model->getAttributes()['slug']);
$this->assertSame('my-test-title', $model->slug);
$this->assertSame('custom-french-slug', $model->translate('slug', 'fr'));
}
Expand Down

0 comments on commit d7c4a45

Please sign in to comment.