Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude committed Apr 4, 2024
1 parent 7c4c5bf commit 366d6dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/JMS/ObjectRouting/Metadata/Driver/AttributeDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

namespace JMS\ObjectRouting\Metadata\Driver;

use JMS\ObjectRouting\Attribute\ObjectRoute;
use JMS\ObjectRouting\Metadata\ClassMetadata;
use Metadata\Driver\DriverInterface;

Expand All @@ -40,7 +41,7 @@ private function fetchAttributes(\ReflectionClass $class): array
{
$attributes = [];

foreach ($class->getAttributes(\JMS\ObjectRouting\Attribute\ObjectRoute::class) as $attr) {
foreach ($class->getAttributes(ObjectRoute::class) as $attr) {
$attributes[] = $attr->newInstance();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

class AttributeDriverTest extends TestCase
{
private readonly AttributeDriver $driver;

public function testLoad()
{
$metadata = $this->driver->loadMetadataForClass(new \ReflectionClass(BlogPostWithAttributes::class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace JMS\Tests\ObjectRouting\Metadata\Driver\Fixture;

use JMS\ObjectRouting\Annotation\ObjectRoute;
use JMS\ObjectRouting\Attribute\ObjectRoute;

#[ObjectRoute(type: "view", name: "blog_post_view", params: ['slug' => 'slug'])]
#[ObjectRoute(type: "edit", name: "blog_post_edit", params: ['slug' => 'slug'])]
Expand Down

0 comments on commit 366d6dd

Please sign in to comment.