Skip to content
This repository was archived by the owner on Jan 1, 2020. It is now read-only.

fix twig extension and fix test factory#36

Merged
flack merged 1 commit intoopenpsa:masterfrom
dbu:fix-twig-extension
Nov 13, 2012
Merged

fix twig extension and fix test factory#36
flack merged 1 commit intoopenpsa:masterfrom
dbu:fix-twig-extension

Conversation

@dbu
Copy link
Collaborator

@dbu dbu commented Nov 12, 2012

this fixes #35

@flack
Copy link
Collaborator

flack commented Nov 13, 2012

I'm merging now since this fixes the immediate problem, but I have to say I still don't really understand why or how that code works in the first place. For example, the typehint in CreatephpExtension's constructor wants Midgard\CreatePHP\Metadata\RdfTypeFactory, but in the unittest, it seems to also accept Test\Midgard\CreatePHP\Extension\Twig\RdfTypeFactory (which almost looks like a bug in php).

Also, the problem is fixed, but if rdftypefactory ever changes again, the same sort of problem might reappear, since the unittest has its own private implementation of the class, so it will never run under "real-life" conditions. At some point, we should probably create an interface for rdftypefactory and convert the rdftypefactory test class to a mock object, so that this kind of problem can be detected more easily

flack added a commit that referenced this pull request Nov 13, 2012
fix twig extension and fix test factory
@flack flack merged commit 7a49013 into openpsa:master Nov 13, 2012
@dbu
Copy link
Collaborator Author

dbu commented Nov 13, 2012

the test factory is just extending the normal factory. having a mock and interface would not have prevented the problem. but we should probably use the arrayloader and the normal factory in the test.

@flack
Copy link
Collaborator

flack commented Nov 13, 2012

Am 13.11.2012 10:28, schrieb David Buchmann:

the test factory is just extending the normal factory.

Ah, ok, so that was the piece of the puzzle I was missing. Suddenly, it
makes sense...

having a mock and
interface would not have prevented the problem. but we should probably
use the arrayloader and the normal factory in the test.

Yes, that sounds like a good plan. I'll make a ticket for that, and then
we can do that when there is time

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Twig extension broken

2 participants