Recommend this page to a friend! |
Download .zip |
Info | Documentation | View files (11) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-07-11 (6 days ago) | Not yet rated by the users | Total: 22 This week: 22 | All time: 11,217 This week: 4 |
Version | License | PHP version | Categories | |||
interface-testing 1.0 | The PHP License | 8 | Data types, Language, Testing, PHP 8 |
Description | Author | |
This package can demonstrate how to test an interface with PHPUnit. |
It is difficult to test an interface directly because it contains signatures and not behaviors.
We could create as many test classes as there are implementations of an interface, but this would be time-consuming and potentially bug-inducing.
An effective solution is to separate the business logic of an interface from the implementation details.
This separation enhances the reliability and relevance of the tests and allows behaviors to be assigned to interfaces.
Files |
File | Role | Description | ||
---|---|---|---|---|
app (3 directories) | ||||
tests (1 directory) | ||||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
phpunit.xml | Data | Auxiliary data | ||
readme.md | Doc. | Documentation |
Files | / | app | / | Adapters |
File | Role | Description |
---|---|---|
UserRepositoryInMemory.php | Class | Class source |
UserRepositoryInSession.php | Class | Class source |
Files | / | tests | / | Unit |
File | Role | Description |
---|---|---|
AbstractUserRepository.php | Class | Class source |
UserRepositoryInMemoryTest.php | Class | Class source |
UserRepositoryInSessionTest.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.