-
Notifications
You must be signed in to change notification settings - Fork 857
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
473592b
commit 577ca67
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Stripe\Sigma; | ||
|
||
/** | ||
* Class Authorization | ||
* | ||
* @property string $id | ||
* @property string $object | ||
* @property int $created | ||
* @property int $data_load_time | ||
* @property string $error | ||
* @property \Stripe\FileUpload $file | ||
* @property bool $livemode | ||
* @property int $result_available_until | ||
* @property string $sql | ||
* @property string $status | ||
* @property string $title | ||
* | ||
* @package Stripe\Sigma | ||
*/ | ||
class ScheduledQueryRun extends \Stripe\ApiResource | ||
{ | ||
const OBJECT_NAME = "scheduled_query_run"; | ||
|
||
use \Stripe\ApiOperations\All; | ||
use \Stripe\ApiOperations\Retrieve; | ||
|
||
public static function classUrl() | ||
{ | ||
return "/v1/sigma/scheduled_query_runs"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
namespace Stripe\Sigma; | ||
|
||
class AuthorizationTest extends \Stripe\TestCase | ||
{ | ||
const TEST_RESOURCE_ID = 'iauth_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); | ||
} | ||
} |