mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Fix the tests
This commit is contained in:
parent
4b16638abd
commit
c3ae6ad8a6
3 changed files with 11 additions and 6 deletions
|
@ -11,7 +11,7 @@ class AuthorizationTest extends TestCase
|
|||
public function testIdAndStatus()
|
||||
{
|
||||
$authorizationStatus = \Mockery::mock(AuthorizationStatus::class);
|
||||
$testee = new Authorization('foo', $authorizationStatus);
|
||||
$testee = new Authorization('foo', $authorizationStatus, null);
|
||||
|
||||
$this->assertEquals('foo', $testee->id());
|
||||
$this->assertEquals($authorizationStatus, $testee->status());
|
||||
|
@ -22,7 +22,7 @@ class AuthorizationTest extends TestCase
|
|||
$authorizationStatus = \Mockery::mock(AuthorizationStatus::class);
|
||||
$authorizationStatus->expects('name')->andReturn('CAPTURED');
|
||||
|
||||
$testee = new Authorization('foo', $authorizationStatus);
|
||||
$testee = new Authorization('foo', $authorizationStatus, null);
|
||||
|
||||
$expected = [
|
||||
'id' => 'foo',
|
||||
|
|
|
@ -17,8 +17,9 @@ class AuthorizationFactoryTest extends TestCase
|
|||
'id' => 'foo',
|
||||
'status' => 'CAPTURED',
|
||||
];
|
||||
$fraudProcessorResponseFactory = \Mockery::mock(FraudProcessorResponseFactory::class);
|
||||
|
||||
$testee = new AuthorizationFactory();
|
||||
$testee = new AuthorizationFactory($fraudProcessorResponseFactory);
|
||||
$result = $testee->from_paypal_response($response);
|
||||
|
||||
$this->assertInstanceOf(Authorization::class, $result);
|
||||
|
@ -36,7 +37,9 @@ class AuthorizationFactoryTest extends TestCase
|
|||
'status' => 'CAPTURED',
|
||||
];
|
||||
|
||||
$testee = new AuthorizationFactory();
|
||||
$fraudProcessorResponseFactory = \Mockery::mock(FraudProcessorResponseFactory::class);
|
||||
|
||||
$testee = new AuthorizationFactory($fraudProcessorResponseFactory);
|
||||
$testee->from_paypal_response($response);
|
||||
}
|
||||
|
||||
|
@ -47,7 +50,9 @@ class AuthorizationFactoryTest extends TestCase
|
|||
'id' => 'foo',
|
||||
];
|
||||
|
||||
$testee = new AuthorizationFactory();
|
||||
$fraudProcessorResponseFactory = \Mockery::mock(FraudProcessorResponseFactory::class);
|
||||
|
||||
$testee = new AuthorizationFactory($fraudProcessorResponseFactory);
|
||||
$testee->from_paypal_response($response);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -251,7 +251,7 @@ class AuthorizedPaymentsProcessorTest extends TestCase
|
|||
}
|
||||
|
||||
private function createAuthorization(string $id, string $status): Authorization {
|
||||
return new Authorization($id, new AuthorizationStatus($status));
|
||||
return new Authorization($id, new AuthorizationStatus($status), null);
|
||||
}
|
||||
|
||||
private function createCapture(string $id, string $status): Capture {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue