Skip to content

Commit

Permalink
Merge pull request #503 from stripe/remi-scheduled-run-mock
Browse files Browse the repository at this point in the history
Move Scheduled Query Run to stripe-mock
  • Loading branch information
ob-stripe authored Jul 31, 2018
2 parents 602242f + 161b200 commit 5c881b4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ php:

env:
global:
- STRIPE_MOCK_VERSION=0.23.0
- STRIPE_MOCK_VERSION=0.24.1
matrix:
- AUTOLOAD=1
- AUTOLOAD=0
Expand Down
15 changes: 0 additions & 15 deletions tests/Stripe/Issuing/TransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@ class TransactionTest extends \Stripe\TestCase
{
const TEST_RESOURCE_ID = 'ipi_123';

// stripe-mock does not support /v1/issuing/transactions yet so we stub it
// and create a fixture for it
public function createFixture()
{
$base = [
'id' => self::TEST_RESOURCE_ID,
'object' => 'issuing.transaction',
'metadata' => [],
];
return Transaction::constructFrom(
$base,
new \Stripe\Util\RequestOptions()
);
}

public function testIsListable()
{
$this->expectsRequest(
Expand Down
36 changes: 0 additions & 36 deletions tests/Stripe/Sigma/ScheduledQueryRunTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,15 @@ class AuthorizationTest extends \Stripe\TestCase
{
const TEST_RESOURCE_ID = 'sqr_123';

// stripe-mock does not support /v1/sigma/scheduled_query_runs yet so we stub it
// and create a fixture for it
public function createFixture()
{
$base = [
'id' => self::TEST_RESOURCE_ID,
'object' => 'scheduled_query_run',
'metadata' => [],
];
return ScheduledQueryRun::constructFrom(
$base,
new \Stripe\Util\RequestOptions()
);
}

public function testIsListable()
{
$this->stubRequest(
'get',
'/v1/sigma/scheduled_query_runs',
[],
null,
false,
[
"object" => "list",
"data" => [
$this->createFixture()
]
]
);
$resources = ScheduledQueryRun::all();
$this->assertTrue(is_array($resources->data));
$this->assertInstanceOf("Stripe\\Sigma\\ScheduledQueryRun", $resources->data[0]);
}

public function testIsRetrievable()
{
$this->stubRequest(
'get',
'/v1/sigma/scheduled_query_runs/' . self::TEST_RESOURCE_ID,
[],
null,
false,
$this->createFixture()
);
$resource = ScheduledQueryRun::retrieve(self::TEST_RESOURCE_ID);
$this->assertInstanceOf("Stripe\\Sigma\\ScheduledQueryRun", $resource);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

define("MOCK_MINIMUM_VERSION", "0.23.0");
define("MOCK_MINIMUM_VERSION", "0.24.1");
define("MOCK_PORT", getenv("STRIPE_MOCK_PORT") ?: 12111);

// Send a request to stripe-mock
Expand Down

0 comments on commit 5c881b4

Please sign in to comment.