Add unit tests for models and services
- Implemented unit tests for the Package model, covering methods such as generateId, findById, findByName, and version management. - Created unit tests for the Repository model, including repository creation, name validation, and retrieval methods. - Added tests for the Session model, focusing on session creation, validation, and invalidation. - Developed unit tests for the User model, ensuring user creation, password hashing, and retrieval methods function correctly. - Implemented AuthService tests, validating login, token refresh, and session management. - Added TokenService tests, covering token creation, validation, and revocation processes.
This commit is contained in:
13
test/fixtures/composer/stacktest/demo-package/README.md
vendored
Normal file
13
test/fixtures/composer/stacktest/demo-package/README.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# stacktest/demo-package
|
||||
|
||||
Demo package for Stack.Gallery Registry e2e tests.
|
||||
|
||||
## Usage
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
use StackTest\DemoPackage\Demo;
|
||||
|
||||
echo Demo::greet("World"); // Hello, World!
|
||||
```
|
||||
21
test/fixtures/composer/stacktest/demo-package/composer.json
vendored
Normal file
21
test/fixtures/composer/stacktest/demo-package/composer.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "stacktest/demo-package",
|
||||
"description": "Demo package for Stack.Gallery Registry e2e tests",
|
||||
"version": "1.0.0",
|
||||
"type": "library",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Stack.Gallery Test",
|
||||
"email": "test@stack.gallery"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=8.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"StackTest\\DemoPackage\\": "src/"
|
||||
}
|
||||
}
|
||||
}
|
||||
20
test/fixtures/composer/stacktest/demo-package/src/Demo.php
vendored
Normal file
20
test/fixtures/composer/stacktest/demo-package/src/Demo.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace StackTest\DemoPackage;
|
||||
|
||||
/**
|
||||
* Demo class for Stack.Gallery Registry e2e tests.
|
||||
*/
|
||||
class Demo
|
||||
{
|
||||
/**
|
||||
* Greet the given name.
|
||||
*
|
||||
* @param string $name The name to greet
|
||||
* @return string A greeting message
|
||||
*/
|
||||
public static function greet(string $name): string
|
||||
{
|
||||
return "Hello, {$name}!";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user