Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MlKilderkin committed Aug 11, 2023
1 parent ba89e79 commit ea25b2a
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tests/wpunit/API/Validation_ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ class Validation_ResponseTest extends UplinkTestCase {
public function setUp() {
parent::setUp();

$this->resource = Register::plugin(
'sample',
$this->resource = $this->getMockBuilder( Plugin::class )->setConstructorArgs( [ 'sample',
'Lib Sample',
'1.0.10',
'uplink/plugin.php',
Uplink::class,
Uplink::class
);
] )->getMock();

$this->resource->method('get_installed_version')->willReturn( '1.0.10' );
}

public function get_dummy_valid_response(): \stdClass {
Expand All @@ -35,15 +36,8 @@ public function get_dummy_api_invalid_response(): \stdClass {
}

public function test_it_should_provide_valid_update_details(): void {
$resource = $this->getMockBuilder( Plugin::class )->setConstructorArgs( [ 'sample',
'Lib Sample',
'1.0.10',
'uplink/plugin.php',
Uplink::class,
Uplink::class
] )->getMock();
$resource->method('get_installed_version')->willReturn( '1.0.10' );
$result = new Validation_Response( 'aaa11', 'local', $this->get_dummy_valid_response(), $resource );

$result = new Validation_Response( 'aaa11', 'local', $this->get_dummy_valid_response(), $this->resource );
$update = $result->get_update_details();

$this->assertEquals( '', $update->id );
Expand Down

0 comments on commit ea25b2a

Please sign in to comment.