Skip to content

Commit

Permalink
Reorder test do group "no redirect" cases
Browse files Browse the repository at this point in the history
  • Loading branch information
MalteWunsch committed Jan 6, 2025
1 parent 454f1b1 commit 7188744
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/EventListener/ValidateSlugListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ public function listenerDoesNotRedirectIfRequestContainsValidSlugForObject(): vo
$this->assertListenerDoesNotRedirectForEvent($event);
}

/**
* Ensures that the listener does not redirect if there is no slug defined
* for the object, despite it's class implementing the SluggableInterface.
*
* @test
*/
public function listenerDoesNotRedirectIfObjectHasNullSlug(): void
{
$sluggable = $this->createSluggable(null);
$event = $this->createEvent([$sluggable], 'invalid-slug');

$this->assertListenerDoesNotRedirectForEvent($event);
}

/**
* @test
*/
Expand Down Expand Up @@ -106,20 +120,6 @@ public function listenerStopsEventPropagationIfRedirectIsNecessary(): void
self::assertTrue($event->isPropagationStopped());
}

/**
* Ensures that the listener does not redirect if there is no slug defined
* for the object, despite it's class implementing the SluggableInterface.
*
* @test
*/
public function listenerDoesNotRedirectIfObjectHasNullSlug(): void
{
$sluggable = $this->createSluggable(null);
$event = $this->createEvent([$sluggable], 'invalid-slug');

$this->assertListenerDoesNotRedirectForEvent($event);
}

/**
* Simulates an object that provides the given slug.
*/
Expand Down

0 comments on commit 7188744

Please sign in to comment.