diff --git a/tests/integrational/FilesTest.php b/tests/integrational/FilesTest.php index 8e615e3d..90366d4d 100644 --- a/tests/integrational/FilesTest.php +++ b/tests/integrational/FilesTest.php @@ -7,7 +7,7 @@ class FilesTest extends PubNubTestCase { protected string $channel = "files-test"; - protected string $textFilePath = __DIR__ . '/assets/spam.txt'; + protected string $textFilePath = __DIR__ . '/assets/spam.spam'; protected string $binaryFilePath = __DIR__ . '/assets/pn.gif'; protected ?string $textFileId; protected ?string $binaryFileId; diff --git a/tests/integrational/assets/spam.spam b/tests/integrational/assets/spam.spam new file mode 100644 index 00000000..fb7ea357 --- /dev/null +++ b/tests/integrational/assets/spam.spam @@ -0,0 +1,10 @@ +Egg and bacon +Egg, sausage and bacon +Egg and spam +Egg, bacon and spam +Egg, bacon, sausage and spam +Spam, bacon, sausage and spam +Spam, egg, spam, spam, bacon and spam +Spam, spam, spam, egg and spam +Spam, spam, spam, spam, spam, spam, baked beans, spam, spam, spam and spam +Lobster thermidor aux crevettes with a mornay sauce garnished with truffle paté, brandy and a fried egg on top and spam \ No newline at end of file diff --git a/tests/integrational/fileSharing/ListFilesTest.php b/tests/integrational/fileSharing/ListFilesTest.php deleted file mode 100644 index f6185ed7..00000000 --- a/tests/integrational/fileSharing/ListFilesTest.php +++ /dev/null @@ -1,59 +0,0 @@ -pubnub); - - $listFiles - ->stubFor("/v1/files/demo/channels/my_channel") - ->withQuery([ - "pnsdk" => $this->encodedSdkName - ]) - ->setResponseBody('{"status": 200, "data": [ - {"id": "my_file_id", "name": "my_file_name", "size": 123, "time_token": 1234567890} - ]}'); - - $response = $listFiles->channel("my_channel")->sync(); - - $this->assertNotEmpty($response); - $this->assertCount(1, $response->getData()); - $this->assertEquals("my_file_id", $response->getData()[0]->getId()); - $this->assertEquals("my_file_name", $response->getData()[0]->getName()); - $this->assertEquals(123, $response->getData()[0]->getSize()); - $this->assertEquals(1234567890, $response->getData()[0]->getTimeToken()); - } -} - -// phpcs:ignore PSR1.Classes.ClassDeclaration -class ListFilesExposed extends ListFiles -{ - protected $transport; - - public function __construct(PubNub $pubnubInstance) - { - parent::__construct($pubnubInstance); - - $this->transport = new StubTransport(); - } - - public function stubFor($url) - { - return $this->transport->stubFor($url); - } - - public function requestOptions() - { - return [ - 'transport' => $this->transport - ]; - } -}