Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Add integration and unit tests #402

Merged
merged 7 commits into from
Aug 28, 2019
Merged

Add integration and unit tests #402

merged 7 commits into from
Aug 28, 2019

Conversation

kienstra
Copy link
Collaborator

@kienstra kienstra commented Aug 26, 2019

  • Add an integration test for all of the fields.
  • Make the unit tests phpcs-compliant, and remove the exclusion of them in phpcs.xml
  • Test all of the fields except for the repeater.
  • Ensure that when they are present as attributes, they work as expected in the block template.

In a future PR

  • Add an integration test for the repeater.
  • Add more unit tests.

Also, add $instance property declarations for
other classes in tests/php/blocks/.
…egration tests

Later, there should be integration tests,
so prepare a separate space for them.
Since the unit tests are moved to tests/php/unit,
change the path of this helper.
This tests all of the fields except for the repeater.
It ensures that when they are present as attributes,
they work as expected in the block template.
Add this to get_special_case_fields,
As it doesn't fit into the other groups of tests.
The unit tests had been excluded in phpcs.xml
This should fix many issues, but there will still be more to fix.
This should be most of the remaining issues.
And running phpcbf should make this easier.
@@ -1,129 +0,0 @@
<?php
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is simply moved to here.

@kienstra kienstra changed the title [WIP] Add integration and unit tests Add integration and unit tests Aug 26, 2019
@kienstra
Copy link
Collaborator Author

kienstra commented Aug 27, 2019

Request For Review

Hi @lukecarbis,
Could you please review this? Ideally it would have an integration test for the repeater, and more unit tests.

But I'd like to switch to working on some Repeater issues, like those reported on Slack.

This PR should help to test PHP regressions in fixes for those.

Almost all of the diff here is from the tests/ directory and config files like phpunit.xml.dist.

composer.json Show resolved Hide resolved
@lukecarbis
Copy link
Member

@kienstra This is fantastic! It would be great if at some point the integration test also tested for blank values, and default values.

@kienstra
Copy link
Collaborator Author

kienstra commented Aug 28, 2019

@kienstra This is fantastic! It would be great if at some point the integration test also tested for blank values, and default values.

Thanks, @lukecarbis! Good point, that's now mentioned in #404.

@kienstra kienstra merged commit a93d9a7 into develop Aug 28, 2019
@kienstra kienstra deleted the add/unit-tests-repeater branch August 28, 2019 03:52
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.

None yet

2 participants