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

[php-slim4] Move Data Mocker to external repo #5930

Merged
merged 8 commits into from
Jun 21, 2020

Conversation

ybelenko
Copy link
Contributor

I think current Mocker deserves it's own repo(even repos). All created packages under MIT license. I added them to Packagist first, but deleted few days after. They not tested enough and not sure that I'm 100% satisfied with created interfaces. While library isn't public(removed from Packagist) it still can be installed via direct Github link like it done in this PR.

I'm open to discussion, especially I wait any thoughts about new interfaces whether they can be helpful as a standalone library.

This PR is 99% ready, the only future change is repo links in composer.json. I'll update them after Packagist publication.

Links to created packages

cc @jebentier, @dkarlovi, @mandrean, @jfastnacht, @ackintosh, @renepardon and special biggest invitation to @jimschubert. I know that you don't like PHP, but if you can give any feedback about new interfaces I appreciate it very much.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@ybelenko ybelenko added this to In progress in PHP Slim4 Server Generator via automation Apr 14, 2020
@ybelenko ybelenko added this to the 5.0.0 milestone Jun 7, 2020
@ybelenko ybelenko force-pushed the exclude-openapi-data-mocker branch 2 times, most recently from 6e4e61a to 7c3e9b5 Compare June 9, 2020 10:48
@ybelenko ybelenko changed the title [Slim4] Move Data Mocker to external repo [php-slim4] Move Data Mocker to external repo Jun 12, 2020
@ybelenko ybelenko force-pushed the exclude-openapi-data-mocker branch from 7c3e9b5 to 0ca1a8b Compare June 14, 2020 17:39
@ybelenko ybelenko marked this pull request as ready for review June 14, 2020 18:49
@ybelenko
Copy link
Contributor Author

ybelenko commented Jun 14, 2020

Test results:

$  composer test
> phpunit
PHPUnit 8.5.5 by Sebastian Bergmann and contributors.

IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII.II.II.IIIIIIIIIIII.II.I  63 / 294 ( 21%)
I.II.II.III.IIII.II.II.IIII.II.IIIII.IIIIIII.II.IIII.III.II.II. 126 / 294 ( 42%)
II.IIII.III.I.IIIIII.III.II.IIIIIIIIIIIIIII.III.IIIII.IIII.III. 189 / 294 ( 64%)
II.II.IIIII.II.IIIIIII.IIII.I.IIIIIII.III.II.III.IIIIII.IIIIIII 252 / 294 ( 85%)
.IIIIIIIII.IIIIIIIIIIIIIIIIIIIIIIIIIIIIII.                      294 / 294 (100%)

Time: 1.11 seconds, Memory: 16.00 MB

OK, but incomplete, skipped, or risky tests!
Tests: 294, Assertions: 144, Incomplete: 246.

with PHPUnit 9

$  composer test
> phpunit
PHPUnit 9.2.3 by Sebastian Bergmann and contributors.

IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII.II.II.IIIIIIIIIIII.II.I  63 / 294 ( 21%)
I.II.II.III.IIII.II.II.IIII.II.IIIII.IIIIIII.II.IIII.III.II.II. 126 / 294 ( 42%)
II.IIII.III.I.IIIIII.III.II.IIIIIIIIIIIIIII.III.IIIII.IIII.III. 189 / 294 ( 64%)
II.II.IIIII.II.IIIIIII.IIII.I.IIIIIII.III.II.III.IIIIII.IIIIIII 252 / 294 ( 85%)
.IIIIIIIII.IIIIIIIIIIIIIIIIIIIIIIIIIIIIII.                      294 / 294 (100%)

Time: 00:00.988, Memory: 16.00 MB

OK, but incomplete, skipped, or risky tests!
Tests: 294, Assertions: 144, Incomplete: 246.

@ybelenko ybelenko force-pushed the exclude-openapi-data-mocker branch from f23f67b to c6d3ac6 Compare June 15, 2020 16:56
@ybelenko ybelenko marked this pull request as draft June 15, 2020 19:56
@ybelenko ybelenko force-pushed the exclude-openapi-data-mocker branch from c6d3ac6 to 87c531c Compare June 19, 2020 08:20
@ybelenko ybelenko marked this pull request as ready for review June 19, 2020 09:02
Beside setters and getters this class implements three methods required
for mocking: getOpenApiSchema, createFromData and jsonSerialize.

BaseModel keeps all data values in $dataContainer like PHP client does.
I don't see other way to support scalar models(enum for instance).
That's why I've removed class variables generation.
This constant will be required for data deserialization when handling
refs.
@ybelenko ybelenko force-pushed the exclude-openapi-data-mocker branch from 87c531c to 41ea439 Compare June 20, 2020 14:46
@wing328
Copy link
Member

wing328 commented Jun 21, 2020

Looks good to me. For the CI failure, I'll try to fix it after merging this PR

@wing328 wing328 merged commit e49804f into OpenAPITools:master Jun 21, 2020
PHP Slim4 Server Generator automation moved this from In progress to Done Jun 21, 2020
@ybelenko ybelenko deleted the exclude-openapi-data-mocker branch June 21, 2020 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants