[TYPO3-extbase-kickstarter] Roundtrip concept for the kickstarter

Nico de Haen typo3 at ndh-websolutions.de
Sat Jul 17 08:16:16 CEST 2010


Hi Stefan,

> 
> How is it possible to test your code? i'm not familiar with the testing
> scenario we currently have in the kickstarter.

you have to install the phpunit extension. Then you will find several
tests for the extbase kickstarter. One test case file is called
Tx_ExtbaseKickstarter_ClassImportFromFile_testcase. It has 4 tests.
These tests are not really unit tests yet, since they run the whole
import process but for now that's ok. When you run the tests you should
see some debug output at the bottom. Each class shows some info about
the import: How many methods, properties, constants, includes, modifiers
and tags were found.

To test the import of other classes you can modify the existing methods
in /Tests/ClassSchemaBuilder_testcase or add new methods or play around
with the Example classes in Tests/Examples

> diff3:
> if(U != B && K != B){
>     /* conflict: model and source have been edited,
>        what should we do? I think we need to find a convention
>        here, which can be applied to each of the files    
>        (tca,domainmodel...)
>     */

With the class parser there is not really a conflict, since the
ClassSchema contains all information about a class.
All we have to do is to decide what should be the default behaviour in
these cases:

1. User added a custom method/property -> keep the it as it is
(maybe we will add some default comment if there is none)

2. User modified a getter or setter method and then renames the property
in the kickstarter:
We can rename his modified methods and keep his modifications. We won't
touch the method body then, so the user has to care of his modifications
himself.

3. User modified a getter or setter method and then removes the
associated property in the kickstarter
Shall we also remove his modified getter/setter methods?

One important thing is, to distinguish between renaming and
removing/adding something:
If a user modified a controller/repository class and then renames the
associated objects/actions then we can keep his modifications. But if he
removes an action and then adds another one, his modifications will be
lost. So the user interface should provide renaming possibilities for
all items.

regards,
Nico



More information about the TYPO3-project-extbase-kickstarter mailing list