Task Description
When we run tests using composer test, it automatically generates a directory called protected/runtime. The directory doesn't serve any purposes and should not be generated during testing.
Steps to Reproduce
- Clone the repository and run
composer install
- Run
composer test to run the tests
- Check
tests folder to find a new subfolder, called runtime
Implementation Guidance
When instantiating the \framework\components\Logger component, a FileLogger instance is generated, which is responsible for creating the directory.
These are the steps we can take to safely resolve it:
- Create a new interface (e.g.
LogDriver) and implement it for FileLogger.
- Remove the log driver from
helpers.php and register it within the test directory
- Allow the
Logger component to accept an optional driver parameter
- Modify the test to mock an implementation of the interface, then inject it within the component
Acceptance Criteria
Please test the following before making a pull request:
- Run
composer test to ensure that all tests are passing
- Make sure that no tests are removed or added, and
Logger component remains above 90% coverage
- Ensure that
FileLogger class is not changed, unless you have a valid reason
Task Description
When we run tests using
composer test, it automatically generates a directory calledprotected/runtime. The directory doesn't serve any purposes and should not be generated during testing.Steps to Reproduce
composer installcomposer testto run the teststestsfolder to find a new subfolder, calledruntimeImplementation Guidance
When instantiating the
\framework\components\Loggercomponent, aFileLoggerinstance is generated, which is responsible for creating the directory.These are the steps we can take to safely resolve it:
LogDriver) and implement it forFileLogger.helpers.phpand register it within the test directoryLoggercomponent to accept an optional driver parameterAcceptance Criteria
Please test the following before making a pull request:
composer testto ensure that all tests are passingLoggercomponent remains above 90% coverageFileLoggerclass is not changed, unless you have a valid reason