phpsa icon indicating copy to clipboard operation
phpsa copied to clipboard

[Tests] Add Definition Tests

Open ddmler opened this issue 8 years ago • 9 comments

We need tests for the definition directory. Currently we only have some for ClassDefinition and RuntimeClassDefinition but those are not complete too.

You don't have to do all, write here which of them you want to add.

ddmler avatar Oct 04 '16 15:10 ddmler

taking ClassDefinition tests

yyaremenko avatar Oct 05 '16 13:10 yyaremenko

hey @ddmler I've found some misprint in your test-related code - 'defiNTion' instead of 'defiNITion', so I'm fixing that as well

yyaremenko avatar Oct 05 '16 15:10 yyaremenko

@ddmler please consider updating phpunit to 5.*, as current "^4.8.26" version is way too out of date

yyaremenko avatar Oct 06 '16 11:10 yyaremenko

@yyaremenko 4.8 was a long term support version i think. the support ends february 2017. if you want make a PR that updates it, i don't know if we use any BC breaking stuff here.

ddmler avatar Oct 06 '16 11:10 ddmler

@yyaremenko @ddmler Don't forget that We support "php": ">=5.5" to run PHPSA

ovr avatar Oct 06 '16 11:10 ovr

@ddmler @ovr guys looks I've found a serious bug in the code while writing tests:

PHPSA\Definition\ClassDefinition constructor allows $statement to be of null type; in the other hand, complie() line 145 creates Event\StatementBeforeCompile instance which, in turn, does not allow null $statement

please advice - should I update the code and disallow null in constructor or should I do it some other way (I am not fully familiar with your code)

yyaremenko avatar Oct 06 '16 12:10 yyaremenko

guys, please reply ASAP, I am blocked (can not proceed with writing tests)

yyaremenko avatar Oct 06 '16 14:10 yyaremenko

remove null for statement, we always give one. :+1:

ddmler avatar Oct 06 '16 15:10 ddmler

@ddmler okay thanx

yyaremenko avatar Oct 06 '16 15:10 yyaremenko