Skip to content
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

Fixed bug in Twig_Loader_Cakephp interface #8

Merged
merged 1 commit into from Jun 8, 2014

Conversation

lhilton
Copy link

@lhilton lhilton commented Apr 15, 2014

Fixed bug in Twig_Loader_Cakephp interface that prevented multiple-template includes and fallback behaviors.

Twig_LoaderInterface defined: https://github.com/fabpot/Twig/blob/master/lib/Twig/LoaderInterface.php

Twig include "array of templates" defined: http://twig.sensiolabs.org/doc/tags/include.html

Signed-off-by: Lee Hilton lee.hilton@hipstercreative.com

…mplate includes and fallback behaviors.

Twig_LoaderInterface defined: https://github.com/fabpot/Twig/blob/master/lib/Twig/LoaderInterface.php

Twig include "array of templates" defined: http://twig.sensiolabs.org/doc/tags/include.html

Signed-off-by: Lee Hilton <lee.hilton@hipstercreative.com>
@WyriHaximus
Copy link
Collaborator

Thanks for the PR @lhilton it looks great but could you take a look at the tests aswel before I merge it?

@lhilton
Copy link
Author

lhilton commented Apr 16, 2014

It is failing because the interface is now emitting the Twig_Error_Loader event for missing templates. It looks like Twig_Loader_cakephpTest.php is testing for View/layout.tpl, which is apparently missing.

Either that is the wrong template file, or it needs to be included in the project. I am not sure what your intent is with trying to load this file. I am also not sure how your test is building the environment for this plugin either. If you could provide some direction for this, I can do another commit.

On April 16, 2014 at 10:56:24 AM, Cees-Jan Kiewiet (notifications@github.com) wrote:

Thanks for the PR @lhilton it looks great but could you take a look at the tests aswel before I merge it?


Reply to this email directly or view it on GitHub.

@WyriHaximus
Copy link
Collaborator

Yeah I see, your changes require new tests. In the original test it just did a call to resolve the file name and return that as cache key. But since you changed that and do a file_exists check and thrown an exception tests need to test all possible outcomes.

I have a separate cake installation on my local development machine where I develop and test plugins on. Loading the deps with composer globally inside that installation :(. (Can't wait for Cake3 tbh, but this does for now.) Also preparing the environment is scripted: https://github.com/WyriHaximus/travis/blob/master/before_script.sh If you feel unconfortable doing that I don't mind doing it myself, you made a great PR even without tests.

@lhilton
Copy link
Author

lhilton commented Apr 16, 2014

I’ll give it a go, I’m going to start forcing 100% test coverage with my employees on the next project we start. This will give me a learning opportunity ahead of that.

I’ll give your before_script.sh a look and possibly ping you with any questions that come out of it.

On April 16, 2014 at 12:52:45 PM, Cees-Jan Kiewiet (notifications@github.com) wrote:

Yeah I see, your changes require new tests. In the original test it just did a call to resolve the file name and return that as cache key. But since you changed that and do a file_exists check and thrown an exception tests need to test all possible outcomes.

I have a separate cake installation on my local development machine where I develop and test plugins on. Loading the deps with composer globally inside that installation :(. (Can't wait for Cake3 tbh, but this does for now.) Also preparing the environment is scripted: https://github.com/WyriHaximus/travis/blob/master/before_script.sh If you feel unconfortable doing that I don't mind doing it myself, you made a great PR even without tests.


Reply to this email directly or view it on GitHub.

@WyriHaximus
Copy link
Collaborator

Ok cool, let me know if you run into anything.

@WyriHaximus
Copy link
Collaborator

@lhilton Did you have any change to work on this? If not, I'm going ahead tomorrow merging your PR and fixing the tests myself :).

WyriHaximus added a commit that referenced this pull request Jun 8, 2014
Fixed bug in Twig_Loader_Cakephp interface
@WyriHaximus WyriHaximus merged commit c2b6535 into cakephp:master Jun 8, 2014
WyriHaximus added a commit that referenced this pull request Jun 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants