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

Replace usage of withConsecutive in phpunit tests #8833

Closed
MasterOdin opened this issue Feb 4, 2023 · 7 comments · Fixed by #8856
Closed

Replace usage of withConsecutive in phpunit tests #8833

MasterOdin opened this issue Feb 4, 2023 · 7 comments · Fixed by #8856

Comments

@MasterOdin
Copy link
Member

In the 9.6.0 release of phpunit, it had:

sebastianbergmann/phpunit#5063: Deprecate withConsecutive()

Where this function will be removed in phpunit 10. We use this in a number of places in Submitty, so we'll want to replace it in whatever is the recommended way for phpunit 9.6+.

@neeraj-2
Copy link

neeraj-2 commented Feb 6, 2023

I would like to work on this one. Can I?

@MasterOdin
Copy link
Member Author

Hi @neeraj-2, due to how our GitHub organization is set up we cannot assign external users to an issue. However, if no one else is assigned/working on the issue, feel free to just post that you're working on it, and then open a pull request! Once you make a pull request, we'll be happy to go through the review process and try to get it merged.

We recommend reading the suggestions for new developers here as well as our How to Contribute guide to help you get started, and if you get stuck on something, feel free to ask on the general chat on Slack.

@saumyaborwankar
Copy link
Contributor

saumyaborwankar commented Feb 8, 2023

hi @MasterOdin I have made changes locally. How can i run test cases to make sure that the new phpunit code runs perfectly. I have made changes in the the files

  • site\tests\app\controllers\admin\ConfigurationControllerTester.php
  • site\tests\app\controllers\course\CourseMaterialsControllerTester.php

I've made a draft PR, if someone can have a look and let me know how, that'd be great. Cheers

@MasterOdin
Copy link
Member Author

MasterOdin commented Feb 8, 2023

To run things locally, you can use composer run test from within the site directory. You can pass -- --filter <name> to the script to run specific tests. See the -- --help doc from phpunit to see more information.

Otherwise, when you make a PR against Submitty, it'll run our test suite against it.

@saumyaborwankar
Copy link
Contributor

saumyaborwankar commented Feb 10, 2023

Hey @MasterOdin when i run composer run test in the \site folder i get 20 errors. Is there something im doing wrong?
this is without making any changes from the main branch of submitty

image

@lucasctd
Copy link

lucasctd commented Mar 7, 2023

Hello folks, hope you are all doing well.

May you help on what I am supposed to use in version 10 to replace the withConsecutive method?
I need a feature like that in my tests but I don't know what I am supposed to do XD

Thx in advance.

@Pursottam6003
Copy link

I would like to work on this issue if possible please assign me

bmcutler pushed a commit that referenced this issue Jun 27, 2023
### Please check if the PR fulfills these requirements:

* [x] Tests for the changes have been added/updated (if possible)
* [ ] Documentation has been updated/added if relevant

### What is the current behavior?
<!-- List issue if it fixes/closes/implements one using the "Fixes
#<number>" or "Closes #<number>" syntax -->
Replaced withConsecutive() with switch statements
Closes #8833

### What is the new behavior?

### Other information?
<!-- Is this a breaking change? --> I don't think its a breaking change.
<!-- How did you test --> Tested it with phpunit using `php
vendor/bin/phpunit
tests/app/controllers/course/CourseMaterialsControllerTester.php` and
`php vendor/bin/phpunit
tests/app/controllers/admin/ConfigurationControllerTester.php`.

I have made changes according to [this

](wikimedia/mediawiki-libs-Equivset@50a1d95)

---------

Co-authored-by: Cameron Peterson <46759635+IDzyre@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants