You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ValueSource::_getSample() creates entity objects from an entity name. The namespace is added to the name for proper creation. This works, but for testing, the path to the entity object is different than the normal path and the namespace is different.
There are several solutions. Right now, I'm using an in-code testing switch:
I'm looking for a 'best practices' solution.
One possibility; why is the TestApp namespaced in this particular way. Could it just as easily be namespaced as App\? Only if that particular namespace declaration never was made by the plugin during actual use. Not sure this is true.
Another possibility; is there an abstracted way I can look up the proper namespace? There are path constants but I don't know of any constant or method that can return a namespace.
Refactoring?
If the class did not allow passing a simple name but instead demanded a fully namespaced name the problem could go away. I'm not sure if this is practical. This is a valid call param but isn't currently used.
This interesting thing is, these ValueObjects are currently deep-internal objects that are not used outside the plugin. So we should be free to refactor this in any way that is convenient. I'm just not sure about how this is integrated into the overall code. I'm not even sure what this process is doing or whether it is truly necessary.
The text was updated successfully, but these errors were encountered:
ValueSource::_getSample()
creates entity objects from an entity name. Thenamespace
is added to the name for proper creation. This works, but for testing, the path to the entity object is different than the normal path and the namespace is different.There are several solutions. Right now, I'm using an in-code testing switch:
I'm looking for a 'best practices' solution.
One possibility; why is the TestApp namespaced in this particular way. Could it just as easily be namespaced as
App\
? Only if that particular namespace declaration never was made by the plugin during actual use. Not sure this is true.Another possibility; is there an abstracted way I can look up the proper namespace? There are
path
constants but I don't know of any constant or method that can return a namespace.Refactoring?
If the class did not allow passing a simple name but instead demanded a fully namespaced name the problem could go away. I'm not sure if this is practical. This is a valid call param but isn't currently used.
This interesting thing is, these ValueObjects are currently deep-internal objects that are not used outside the plugin. So we should be free to refactor this in any way that is convenient. I'm just not sure about how this is integrated into the overall code. I'm not even sure what this process is doing or whether it is truly necessary.
The text was updated successfully, but these errors were encountered: