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

Update PHP, PHPUnit, DataValues, Interfaces #91

Merged
merged 5 commits into from
Sep 28, 2020
Merged

Conversation

lucaswerkmeister
Copy link
Member

Update PHP versions and dependencies on PHPUnit, DataValues and Interfaces. See individual commit messages for details.

I assume this will fail in CI until the new versions of DataValues and Interfaces have been released – I tested this locally by symlinking my Git checkouts into vendor/data-values/.

PHP upstream doesn’t support any versions older than 7.2. (In fact even
7.2 is barely supported anymore, but we still expect to use it in
Wikimedia production for a while, so the library should stay compatible
for the time being.)
This is a lot of changes at once, but I don’t think they can be split.
The most important changes are:

* The DataValueTest class was removed from DataValues. The release notes
  advise to “refactor away the bad design”, so I tried to rewrite the
  tests in a way that makes sense to me: instead of having one test per
  method (where many tests will end up calling other methods anyways,
  e. g. most test methods will also effectively test the constructor),
  test scenarios of how methods might be used in conjunction, e. g.
  serialize+unserialize.

* The ValueFormatterTestBase class was removed from Interfaces. Its use
  can be substituted in the individual test classes relatively easily.

* PHPUnit_Framework_TestCase is now PHPUnit\Framework\TestCase.
  PHPUnit_Framework_MockObject_Matcher_Invocation seems to have no
  replacement that’s not marked @internal, so leave that parameter
  untyped.

* getMock() is now createMock().

* @ExpectedException or setExpectedException() is now expectException().
Removed from DataValues in 3.0.0.
@@ -16,22 +18,37 @@
* @license GPL-2.0+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class MonolingualTextValueTest extends DataValueTest {
class MonolingualTextValueTest extends TestCase {
Copy link
Member

Choose a reason for hiding this comment

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

👍

JeroenDeDauw and others added 2 commits September 25, 2020 17:25
If we want to declare compatibility with older DataValues versions, we
need to keep them around. Mark them as deprecated instead.

This reverts commit c1f33d7.
@JeroenDeDauw JeroenDeDauw merged commit cb36655 into master Sep 28, 2020
@JeroenDeDauw JeroenDeDauw deleted the modernize branch September 28, 2020 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants