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

Tests: Stop using deprecated setMethods method #427

Merged
merged 2 commits into from
Oct 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/Unit/Integrations/IntegrationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ public function test_an_integration_can_be_registered_to_a_new_Integrations_obje
* @uses \Parsely\Integrations\Integrations::register
*/
public function test_registered_integrations_have_their_integrate_method_called(): void {
$mock_integration = $this->getMockBuilder( Integration::class )->setMethods( array( 'integrate' ) )->getMock();
$mock_builder = $this->getMockBuilder( Integration::class );
// See https://github.com/Parsely/wp-parsely/issues/426.
if ( method_exists( $mock_builder, 'onlyMethods' ) ) {
$mock_integration = $mock_builder->onlyMethods( array( 'integrate' ) )->getMock();
} else {
$mock_integration = $mock_builder->setMethods( array( 'integrate' ) )->getMock();
}
$mock_integration->expects( $this->once() )->method( 'integrate' );

$integrations = new Integrations();
Expand Down