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

Add (more) unit-tests #25

Open
Potherca opened this issue Aug 29, 2022 · 1 comment
Open

Add (more) unit-tests #25

Potherca opened this issue Aug 29, 2022 · 1 comment
Assignees

Comments

@Potherca
Copy link
Member

Main focus

The majority of the classes in this project are data containers.

Although writing unit-tests for the non-logic classes will be a lot easier, the main focus for quality should be on the Server, TokenGenerator, and WAC classes, and code under the src/Utils directory.

Other classes

Config

The files in the Config directory are mostly data objects. They are small enough that adding tests should be trivial, simply test the output of getter methods.

Entity

The clases under this directory are all just container that use traits from the vendor project.
No testing for these is needed, as tests are already provided by the upstream.

Enum

All classes un der the src/Enum directory only contain data, except for Enum/OpenId/OpenIdConnectMetadata and Enum/OAuth2/Parameter. Both extend an abstract parent. An abstract test class has alread been created, plus tests for OpenIdConnectMetadata. It should be trivial, following the example of the existing code, to also add a test for the OAuth2/Parameter class.

Factory

Classes under the Factory directory are factories. Simple input/output (call the factory with a specific input, validate a specific output is provided) tests should suffice.

Repository

The code under the Repository directory is a mix of factory and data container. Tests would be mostly similar to that of factories.

@Potherca
Copy link
Member Author

Update

summary

v0.7.0 v0.8.0
Classes 0.00% (0/26) 0.00% (0/27)
Methods 5.00% (6/120) 11.29% (14/124)
Lines 4.55% (31/682) 21.15% (151/714)

v0.7.0

  • Pdsinterop\Solid\Auth\Config\Server
    • Methods: 50.00% ( 4/ 8) Lines: 85.71% ( 24/ 28)
  • Pdsinterop\Solid\Auth\Enum\AbstractEnum
    • Methods: 50.00% ( 2/ 4) Lines: 63.64% ( 7/ 11)

v0.8.0

  • Pdsinterop\Solid\Auth\Config\Server
    • Methods: 50.00% ( 4/ 8) Lines: 85.71% ( 24/ 28)
  • Pdsinterop\Solid\Auth\Enum\AbstractEnum
    • Methods: 50.00% ( 2/ 4) Lines: 63.64% ( 7/ 11)
  • Pdsinterop\Solid\Auth\TokenGenerator
    • Methods: 66.67% ( 6/ 9) Lines: 63.01% ( 46/ 73)
  • Pdsinterop\Solid\Auth\Utils\DPop
    • Methods: 28.57% ( 2/ 7) Lines: 74.75% ( 74/ 99)

@Potherca Potherca self-assigned this Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant