-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
T14584 factories #14592
T14584 factories #14592
Conversation
Codecov Report
@@ Coverage Diff @@
## 4.0.x #14592 +/- ##
==========================================
- Coverage 67.75% 67.72% -0.03%
==========================================
Files 488 488
Lines 112710 112590 -120
==========================================
- Hits 76368 76256 -112
+ Misses 36342 36334 -8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test as well?
I already had this pending. Can also submit it after merging.
/**
* Tests issue 14584. Use load twice
*
* @author Ruud Boon <team@phalcon.io>
* @since 2019-12-06
*/
public function loadTwice(UnitTester $I)
{
$I->wantToTest('Config\ConfigFactory - load() - issue 14584');
$factory = new ConfigFactory();
$configFile1 = dataDir('assets/config/config.php');
$config = $factory->load($configFile1);
$I->assertEquals("/phalcon/", $config->phalcon->baseUri);
$configFile2 = dataDir('assets/config/config-2.php');
$config2 = $factory->load($configFile2);
$I->assertEquals("/phalcon4/", $config2->phalcon->baseUri);
}
Test added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you copy assets/config/config.php to assets/config/config-2.php and change phalcon to phalcon4?
https://github.com/phalcon/cphalcon/tree/4.0.x/tests/_data/assets/config
Hello!
In raising this pull request, I confirm the following:
I have read and understood the Contributing Guidelines
I have checked that another pull request for this purpose does not exist
I wrote some tests for this PR
I have updated the relevant CHANGELOG
I have created a PR for the documentation about this change
Fixed factories to return a new instance when calling
newInstance
and not a cached one from the internal mapperPhalcon/Annotations/AnnotationsFactory
Phalcon/Cache/AdapterFactory
Phalcon/Config/ConfigFactory
Phalcon/Db/Adapter/PdoFactory
Phalcon/Image/ImageFactory
Phalcon/Logger/AdapterFactory
Phalcon/Paginator/PaginatorFactory
Phalcon/Storage/AdapterFactory
Phalcon/Storage/SerializerFactory
Phalcon/Translate/InterpolatorFactory
Phalcon/Translate/TranslateFactory
Phalcon/Validation/ValidatorFactory
Thanks