Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stripe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Extensions
Stripe
Commits
9936ccfa
Commit
9936ccfa
authored
3 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Test fixes
parent
4b980053
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!176
Release 6.7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/phpunit/CRM/Stripe/BaseTest.php
+18
-16
18 additions, 16 deletions
tests/phpunit/CRM/Stripe/BaseTest.php
tests/phpunit/CRM/Stripe/IpnTest.php
+2
-3
2 additions, 3 deletions
tests/phpunit/CRM/Stripe/IpnTest.php
with
20 additions
and
19 deletions
tests/phpunit/CRM/Stripe/BaseTest.php
+
18
−
16
View file @
9936ccfa
...
...
@@ -54,17 +54,26 @@ abstract class CRM_Stripe_BaseTest extends \PHPUnit\Framework\TestCase implement
];
public
function
setUpHeadless
()
{
}
public
function
setUp
():
void
{
parent
::
setUp
();
// we only need to do the shared library once
// Civi\Test has many helpers, like install(), uninstall(), sql(), and sqlFile().
// See: https://github.com/civicrm/org.civicrm.testapalooza/blob/master/civi-test.md
static
$reInstallOnce
=
TRUE
;
$reInstall
=
FALSE
;
if
(
!
isset
(
$reInstallOnce
))
{
$reInstallOnce
=
TRUE
;
$reInstall
=
TRUE
;
}
if
(
!
is_dir
(
__DIR__
.
'/../../../../../mjwshared'
))
{
civicrm_api3
(
'Extension'
,
'download'
,
[
'key'
=>
'mjwshared'
]);
}
else
{
civicrm_api3
(
'Extension'
,
'install'
,
[
'keys'
=>
'mjwshared'
]);
}
return
\Civi\Test
::
headless
()
->
installMe
(
__DIR__
)
->
install
(
'mjwshared'
)
->
apply
(
$reInstall
);
}
public
function
setUp
():
void
{
civicrm_api3
(
'Extension'
,
'install'
,
[
'keys'
=>
'com.drastikbydesign.stripe'
]);
require_once
(
'vendor/stripe/stripe-php/init.php'
);
$this
->
createPaymentProcessor
();
...
...
@@ -72,13 +81,6 @@ abstract class CRM_Stripe_BaseTest extends \PHPUnit\Framework\TestCase implement
$this
->
created_ts
=
time
();
}
public
function
tearDown
():
void
{
civicrm_api3
(
'PaymentProcessor'
,
'delete'
,
[
'id'
=>
$this
->
paymentProcessorID
]);
civicrm_api3
(
'Extension'
,
'disable'
,
[
'keys'
=>
'com.drastikbydesign.stripe'
]);
civicrm_api3
(
'Extension'
,
'uninstall'
,
[
'keys'
=>
'com.drastikbydesign.stripe'
]);
parent
::
tearDown
();
}
/**
*
*/
...
...
@@ -515,7 +517,7 @@ class PropertySpy implements ArrayAccess, Iterator, Countable, JsonSerializable
/**
* Stubs a method by returning a value from a map.
*/
class
ValueMapOrDie
implements
\PHPUnit\Framework\MockObject\Stub
{
class
ValueMapOrDie
implements
\PHPUnit\Framework\MockObject\Stub
\Stub
{
use
\PHPUnit\Framework\MockObject\Api
;
...
...
This diff is collapsed.
Click to expand it.
tests/phpunit/CRM/Stripe/IpnTest.php
+
2
−
3
View file @
9936ccfa
...
...
@@ -50,7 +50,6 @@ class CRM_Stripe_IpnTest extends CRM_Stripe_BaseTest {
* update it after creation. @todo The membership should also be updated.
*/
public
function
testNewRecurringInvoicePaymentSucceeded
()
{
$this
->
mockRecurringPaymentSetup
();
$this
->
simulateEvent
([
'type'
=>
'invoice.payment_succeeded'
,
...
...
@@ -940,7 +939,7 @@ class CRM_Stripe_IpnTest extends CRM_Stripe_BaseTest {
]);
//
// Check the Co
t
nributionRecur
// Check the Con
t
ributionRecur
//
// The subscription ID should be in both processor_id and trxn_id fields
// We expect it to be pending
...
...
@@ -954,7 +953,7 @@ class CRM_Stripe_IpnTest extends CRM_Stripe_BaseTest {
/**
*
*/
protected
function
returnValueMapOrDie
(
$map
)
:
ValueMapOrDie
{
protected
function
returnValueMapOrDie
(
$map
):
ValueMapOrDie
{
return
new
ValueMapOrDie
(
$map
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment