diff --git a/src/Event/CasAfterValidateEvent.php b/src/Event/CasPostValidateEvent.php similarity index 94% rename from src/Event/CasAfterValidateEvent.php rename to src/Event/CasPostValidateEvent.php index 6339e6c..946a37d 100644 --- a/src/Event/CasAfterValidateEvent.php +++ b/src/Event/CasPostValidateEvent.php @@ -15,7 +15,7 @@ use Symfony\Component\EventDispatcher\Event; * Subscribers of this event can parse the response from the CAS server and * modify the CasPropertyBag. */ -class CasAfterValidateEvent extends Event { +class CasPostValidateEvent extends Event { /** * The raw validation response data from CAS server. @@ -32,7 +32,7 @@ class CasAfterValidateEvent extends Event { protected $casPropertyBag; /** - * CasAfterValidateEvent constructor. + * CasPostValidateEvent constructor. * * @param string $response_data * The raw validation response data from CAS server. diff --git a/src/Service/CasHelper.php b/src/Service/CasHelper.php index 2d5f4a3..b3dc4f8 100644 --- a/src/Service/CasHelper.php +++ b/src/Service/CasHelper.php @@ -86,7 +86,7 @@ class CasHelper { * * @var string */ - const EVENT_AFTER_VALIDATE = 'cas.after_validate'; + const EVENT_POST_VALIDATE = 'cas.post_validate'; /** * Stores settings object. diff --git a/src/Service/CasValidator.php b/src/Service/CasValidator.php index 6dd3657..0ff057b 100644 --- a/src/Service/CasValidator.php +++ b/src/Service/CasValidator.php @@ -2,7 +2,7 @@ namespace Drupal\cas\Service; -use Drupal\cas\Event\CasAfterValidateEvent; +use Drupal\cas\Event\CasPostValidateEvent; use Drupal\cas\Exception\CasValidateException; use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Config\ConfigFactoryInterface; @@ -147,8 +147,8 @@ class CasValidator { } // Dispatch an event that allows others to alter the Cas property bag. - $event = new CasAfterValidateEvent($response_data, $cas_property_bag); - $this->eventDispatcher->dispatch(CasHelper::EVENT_AFTER_VALIDATE, $event); + $event = new CasPostValidateEvent($response_data, $cas_property_bag); + $this->eventDispatcher->dispatch(CasHelper::EVENT_POST_VALIDATE, $event); return $event->getCasPropertyBag(); } diff --git a/tests/src/Unit/Service/CasValidatorTest.php b/tests/src/Unit/Service/CasValidatorTest.php index 7f5ea63..d0a0f87 100644 --- a/tests/src/Unit/Service/CasValidatorTest.php +++ b/tests/src/Unit/Service/CasValidatorTest.php @@ -2,7 +2,7 @@ namespace Drupal\Tests\cas\Unit\Service; -use Drupal\cas\Event\CasAfterValidateEvent; +use Drupal\cas\Event\CasPostValidateEvent; use Drupal\Tests\UnitTestCase; use Drupal\cas\Service\CasValidator; use Drupal\cas\CasPropertyBag; @@ -56,10 +56,10 @@ class CasValidatorTest extends UnitTestCase { * * @param string $event_name * Name of event fired. - * @param \Drupal\cas\Event\CasAfterValidateEvent $event + * @param \Drupal\cas\Event\CasPostValidateEvent $event * Event fired. */ - public function dispatchEvent($event_name, CasAfterValidateEvent $event) { + public function dispatchEvent($event_name, CasPostValidateEvent $event) { $this->events[$event_name] = $event; $propertyBag = $event->getCasPropertyBag(); $propertyBag->setAttribute('email', ['modified@example.com']);