GithubHelp home page GithubHelp logo

Better tests for Twig extension about createphp HOT 5 OPEN

flack avatar flack commented on August 15, 2024
Better tests for Twig extension

from createphp.

Comments (5)

dbu avatar dbu commented on August 15, 2024

i started working on making the twig test a full functional test that does not mock anything of createphp. this requires the whole phpcr-odm stack to dev, because the only mapper we have atm is the DoctrinePhpcrOdmMapper... but it actually works (and i fixed a couple of errors in the phcpr-odm doc along the way of bootstrapping this in the test).

anyways, now i am stuck on the problem that since the last refactorings, there seems to be no way to have simple collections of just strings, like the tags we have in our sample model. i won't find a solution for that problem tonight, but will try again on friday.

from createphp.

flack avatar flack commented on August 15, 2024

Am 14.11.12 21:40, schrieb David Buchmann:

i started working on making the twig test a full functional test that
does not mock anything of createphp. this requires the whole phpcr-odm
stack to dev, because the only mapper we have atm is the
DoctrinePhpcrOdmMapper... but it actually works (and i fixed a couple of
errors in the phcpr-odm doc along the way of bootstrapping this in the
test).

anyways, now i am stuck on the problem that since the last refactorings,
there seems to be no way to have simple collections of just strings,
like the tags we have in our sample model. i won't find a solution for
that problem tonight, but will try again on friday.

yeah, no problem, we're not in a hurry :-)

Anyways, about the mapper: I had this problem, too in some unittests and
made the MockMapper class (which uses a simle array format as "storage
object"). Since mapper is framework-specific and adheres to an
interface, I don't find it so bad that it's fake. If the phpcr thing is
working, that's fine, too, even if it sounds a bit heavy :-)


Reply to this email directly or view it on GitHub
#37 (comment).

from createphp.

dbu avatar dbu commented on August 15, 2024

thanks for the tip, MockMappers seems to be able to do what i need, much nicer than having all of doctrine in the project.

however, i am still unsure what to do. the problem is with things like tags where we neither specify a "type" in the mapping nor are the single tags objects that the type factory could find rdf types for. what would be the right behaviour? should we provide a simple plaintext default type for such cases? its only a problem with collection items that are not themselves again complex types...
and does anybody have a good example of the html tags that are needed to make the createjs tags widget work? http://createjs.org/guide/#tags

@bergie do you happen to have an example of how the tags should look like in html?

from createphp.

flack avatar flack commented on August 15, 2024

Am 16.11.12 17:38, schrieb David Buchmann:

thanks for the tip, MockMappers seems to be able to do what i need, much
nicer than having all of doctrine in the project.

however, i am still unsure what to do. the problem is with things like
tags where we neither specify a "type" in the mapping nor are the single
tags objects that the type factory could find rdf types for. what would
be the right behaviour? should we provide a simple plaintext default
type for such cases? its only a problem with collection items that are
not themselves again complex types...

Hm, I don't know how this is supposed to work in Create.js, but ow
exactly does it work on your end? I mean, if tags are not some form of
staorage entity, I imagine they must be something like a property of
another object, right? So like f.x. a comma-separated string that gets
saved in the DB's "article" table in the "tags" column. If this is the
case, then maybe it would be best not to use a collection here, but
rather define tags as a normal property and then configure a different
editor (e.g. jquery.ui autocomplete) for it. I'm not sure if Create.js
supports this yet, but it should, since at some point, we will want to
use datepickers and the like, too

from createphp.

dbu avatar dbu commented on August 15, 2024

storage in phpcr is a multivalue field. in an orm a serialized array could be used. or a separate table with n-m relations. there is this tag plugin in create.js that afaik treats tags somehow as entities (CRUD of items in the dom structure but it does not end up being persisted separatly like a normal collection.) this is why i would love to see a working real-world example of the tags plugin with the minimum/best-practice html structure.
from how our mappings looked before, i start to think we could just configure a Type for string, as we have one for each entity class. but that type would then have one single property, the string value.

the plugin used to work in the cmf sandbox, but does no longer and either way i have no clue what we where doing... @bergie, is there a good example of that html structure somewhere? would love to do it the right way.

from createphp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.