Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add shield version for Increase improvement #675

Merged
merged 5 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
*/
class Auth
{
/**
* The current version of CodeIgniter Shield
*/
public const SHIELD_VERSION = 'v1.0.0-beta.5';
datamweb marked this conversation as resolved.
Show resolved Hide resolved

protected Authentication $authenticate;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Collectors/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Auth extends BaseCollector
*
* @var string
*/
protected $title = 'Auth';
protected $title = 'Shield';
datamweb marked this conversation as resolved.
Show resolved Hide resolved

private ShieldAuth $auth;

Expand All @@ -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());
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/Collectors/AuthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -71,6 +72,7 @@ public function testGetTitleDetails(): void
{
$output = $this->collector->getTitleDetails();

$this->assertStringContainsString(ShieldAuth::SHIELD_VERSION, $output);
$this->assertStringContainsString(Session::class, $output);
}

Expand Down