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 dependency phpunit/phpunit to v10 #67

Merged
merged 4 commits into from
Nov 21, 2023

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Feb 3, 2023

Mend Renovate logo banner

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
phpunit/phpunit (source) ^9.5.26 -> ^10.0.0 age adoption passing confidence

Release Notes

sebastianbergmann/phpunit (phpunit/phpunit)

v10.4.2

Compare Source

v10.4.1

Compare Source

v10.4.0

Compare Source

v10.3.5

Compare Source

v10.3.4

Compare Source

v10.3.3

Compare Source

v10.3.2

Compare Source

v10.3.1

Compare Source

v10.3.0

Compare Source

v10.2.7

Compare Source

v10.2.6

Compare Source

v10.2.5

Compare Source

v10.2.4

Compare Source

v10.2.3

Compare Source

v10.2.2

Compare Source

v10.2.1

Compare Source

v10.2.0

Compare Source

v10.1.3

Compare Source

v10.1.2

Compare Source

v10.1.1

Compare Source

v10.1.0

Compare Source

v10.0.19

Compare Source

v10.0.18

Compare Source

v10.0.17

Compare Source

v10.0.16

Compare Source

v10.0.15

Compare Source

v10.0.14

Compare Source

v10.0.13

Compare Source

v10.0.12

Compare Source

v10.0.11

Compare Source

v10.0.10

Compare Source

v10.0.9

Compare Source

v10.0.8

Compare Source

v10.0.7

Compare Source

v10.0.6

Compare Source

v10.0.5

Compare Source

v10.0.4

Compare Source

v10.0.3

Compare Source

v10.0.2

Compare Source

v10.0.1

Compare Source

v10.0.0

Compare Source

v9.6.13

Compare Source

v9.6.12

Compare Source

v9.6.11

Compare Source


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

Read more information about the use of Renovate Bot within Laminas.

@renovate renovate bot added the renovate label Feb 3, 2023
@renovate renovate bot force-pushed the renovate/phpunit-phpunit-10.x branch from 979e72b to b013ad8 Compare May 28, 2023 08:58
@renovate renovate bot force-pushed the renovate/phpunit-phpunit-10.x branch from b013ad8 to 7c264f7 Compare July 17, 2023 06:53
@renovate renovate bot changed the base branch from 3.3.x to 3.4.x July 17, 2023 06:56
@renovate renovate bot force-pushed the renovate/phpunit-phpunit-10.x branch 2 times, most recently from efc3581 to 49d0b97 Compare July 20, 2023 03:10
@renovate renovate bot force-pushed the renovate/phpunit-phpunit-10.x branch from 49d0b97 to 51c5dbf Compare July 27, 2023 03:14
@renovate renovate bot force-pushed the renovate/phpunit-phpunit-10.x branch 3 times, most recently from 0bcea3f to 7cd5bb3 Compare November 21, 2023 11:54
renovate bot and others added 2 commits November 21, 2023 22:04
| datasource | package         | from   | to     |
| ---------- | --------------- | ------ | ------ |
| packagist  | phpunit/phpunit | 9.6.13 | 10.4.2 |

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Aleksei Khudiakov <aleksey@xerkus.pro>
@Xerkus Xerkus force-pushed the renovate/phpunit-phpunit-10.x branch from 7cd5bb3 to 407c3f5 Compare November 21, 2023 14:37
Copy link
Contributor Author

renovate bot commented Nov 21, 2023

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

Warning: custom changes will be lost.

Signed-off-by: Aleksei Khudiakov <aleksey@xerkus.pro>
@Xerkus Xerkus force-pushed the renovate/phpunit-phpunit-10.x branch from 407c3f5 to 1909ba2 Compare November 21, 2023 14:38
Signed-off-by: Aleksei Khudiakov <aleksey@xerkus.pro>
Comment on lines +198 to +231
$consecutiveArguments[] = self::callback(static function (string $argument) use ($information): bool {
return preg_match(
sprintf('/%s/', preg_quote($argument, '/')),
$information
) !== false;
});
}

$consecutive = new class ($consecutiveArguments) extends Constraint {
/**
* @param list<Constraint> $assertions
*/
public function __construct(private array $assertions)
{
$this->assertions[] = new IsAnything();
}

public function matches(mixed $other): bool
{
$assertion = current($this->assertions);
next($this->assertions);
return $assertion->matches($other);
}

public function toString(): string
{
return current($this->assertions)->toString();
}
};

$this->io
->expects(self::exactly(count($consecutiveArguments)))
->method('write')
->withConsecutive(...$consecutiveArguments);
->with($consecutive);
Copy link
Member

Choose a reason for hiding this comment

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

I would like to draw attention to this part implementing constraint replacement for removed withConsecutive()

Copy link
Member

Choose a reason for hiding this comment

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

I think this approach is fine: we're recording stuff, then verifying order at the end.

Copy link
Member

Choose a reason for hiding this comment

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

This one essentially a custom constraint composing actual constraints and iterating over them on consecutive invocations. If phpunit decides to call constraint multiple times in the future for whatever reason this will break but it is fairly unlikely.

Unlike withConsecutive() this constraint can match only one parameter but here that is exactly what is needed.

I took this approach over willReturnCallback() since I want mock object to record assertion failures as it normally does instead of risking them getting caught by try-catch somewhere in the tested call stack.

@Xerkus Xerkus added this to the 3.4.0 milestone Nov 21, 2023
@Xerkus Xerkus merged commit e4c15d5 into 3.4.x Nov 21, 2023
24 checks passed
@Xerkus Xerkus deleted the renovate/phpunit-phpunit-10.x branch November 21, 2023 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants