-
Notifications
You must be signed in to change notification settings - Fork 132
FilesystemLoader and Testing #115
Comments
Alternatively the optional handling can go into one protected method while the directory checking goes into another, both of which would be called in constructor. Then people can extend to do custom behavior, such as accounting for vsf. |
@DaveStein Thanks, I look into it if I get more spare time. |
@fzerorubigd which way do you like better? Accounting for |
@DaveStein using |
kk I'll fork and make the change sometime between Sunday and Tuesday or so. I'll be away this weekend or I'd do it sooner :) |
I believe supporting of custom stream wrappers (not only vfs://) could be useful in many cases not only for testing. For example they are used in Drupal 7 a lot. At the same time I don't like how the check is done in mustache.php. May be it's better to use something like stream_get_wrappers function. What do you think @fzerorubigd ? |
@JustBlackBird I like the idea. |
@JustBlackBird @fzeroubigd i got my PR for this here #117... maybe after that Just can add the streaming bit. My change makes things more extendable and then his makes things better on top of that. |
I just swapped my templates from mustache to handlebars using this lib. I have a unit test to verify that given a certain file, it will return a certain output.
I am using https://github.com/mikey179/vfsStream to mock the file system, but that doesn't work with this lib because of
realpath
being used in the constructor.The directory comes in as
vfs://mydir
. You can see in this popular Mustache loader, how they handle it:https://github.com/bobthecow/mustache.php/blob/master/src/Mustache/Loader/FilesystemLoader.php#L52
What do you think?
The text was updated successfully, but these errors were encountered: