From 3493e70933749e0c7f0fff349381e069a246a1e4 Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Thu, 15 Nov 2018 17:28:41 +0100 Subject: [PATCH] Remove FileUpload alias --- init.php | 1 - lib/FileUpload.php | 6 --- lib/Sigma/ScheduledQueryRun.php | 2 +- tests/Stripe/FileUploadCreationTest.php | 64 ------------------------- tests/Stripe/FileUploadTest.php | 45 ----------------- 5 files changed, 1 insertion(+), 117 deletions(-) delete mode 100644 lib/FileUpload.php delete mode 100644 tests/Stripe/FileUploadCreationTest.php delete mode 100644 tests/Stripe/FileUploadTest.php diff --git a/init.php b/init.php index 2590305aa..b6744b5df 100644 --- a/init.php +++ b/init.php @@ -80,7 +80,6 @@ require(dirname(__FILE__) . '/lib/ExchangeRate.php'); require(dirname(__FILE__) . '/lib/File.php'); require(dirname(__FILE__) . '/lib/FileLink.php'); -require(dirname(__FILE__) . '/lib/FileUpload.php'); require(dirname(__FILE__) . '/lib/Invoice.php'); require(dirname(__FILE__) . '/lib/InvoiceItem.php'); require(dirname(__FILE__) . '/lib/InvoiceLineItem.php'); diff --git a/lib/FileUpload.php b/lib/FileUpload.php deleted file mode 100644 index 1d8725b4c..000000000 --- a/lib/FileUpload.php +++ /dev/null @@ -1,6 +0,0 @@ -expectsRequest( - 'post', - '/v1/files', - null, - ['Content-Type: multipart/form-data'], - true, - Stripe::$apiUploadBase - ); - $fp = fopen(dirname(__FILE__) . '/../data/test.png', 'r'); - $resource = FileUpload::create([ - "purpose" => "dispute_evidence", - "file" => $fp, - ]); - $this->assertInstanceOf("Stripe\\FileUpload", $resource); - } - - public function testIsCreatableWithCurlFile() - { - $this->expectsRequest( - 'post', - '/v1/files', - null, - ['Content-Type: multipart/form-data'], - true, - Stripe::$apiUploadBase - ); - $curlFile = new \CurlFile(dirname(__FILE__) . '/../data/test.png'); - $resource = FileUpload::create([ - "purpose" => "dispute_evidence", - "file" => $curlFile, - ]); - $this->assertInstanceOf("Stripe\\FileUpload", $resource); - } -} diff --git a/tests/Stripe/FileUploadTest.php b/tests/Stripe/FileUploadTest.php deleted file mode 100644 index 4b23de67f..000000000 --- a/tests/Stripe/FileUploadTest.php +++ /dev/null @@ -1,45 +0,0 @@ -expectsRequest( - 'get', - '/v1/files' - ); - $resources = FileUpload::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\FileUpload", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/files/' . self::TEST_RESOURCE_ID - ); - $resource = FileUpload::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\FileUpload", $resource); - } - - public function testDeserializesFromFile() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'file', - ], null); - $this->assertInstanceOf("Stripe\\FileUpload", $obj); - } - - public function testDeserializesFromFileUpload() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'file_upload', - ], null); - $this->assertInstanceOf("Stripe\\FileUpload", $obj); - } -}