diff --git a/src/Auth.php b/src/Auth.php index 35e5bd30f..4ec710a5a 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -25,6 +25,11 @@ */ class Auth { + /** + * The current version of CodeIgniter Shield + */ + public const SHIELD_VERSION = '1.0.0-beta.5'; + protected Authentication $authenticate; /** diff --git a/src/Collectors/Auth.php b/src/Collectors/Auth.php index ad19e5637..f265b2e58 100644 --- a/src/Collectors/Auth.php +++ b/src/Collectors/Auth.php @@ -56,7 +56,7 @@ public function __construct() */ public function getTitleDetails(): string { - return get_class($this->auth->getAuthenticator()); + return ShieldAuth::SHIELD_VERSION . ' | ' . get_class($this->auth->getAuthenticator()); } /** diff --git a/tests/Collectors/AuthTest.php b/tests/Collectors/AuthTest.php index 1c3c50495..45d7a5871 100644 --- a/tests/Collectors/AuthTest.php +++ b/tests/Collectors/AuthTest.php @@ -4,6 +4,7 @@ namespace Tests\Collectors; +use CodeIgniter\Shield\Auth as ShieldAuth; use CodeIgniter\Shield\Authentication\Authenticators\Session; use CodeIgniter\Shield\Collectors\Auth; use CodeIgniter\Shield\Entities\User; @@ -71,6 +72,7 @@ public function testGetTitleDetails(): void { $output = $this->collector->getTitleDetails(); + $this->assertStringContainsString(ShieldAuth::SHIELD_VERSION, $output); $this->assertStringContainsString(Session::class, $output); }