Passed
Pull Request — master (#60)
by
unknown
13:05
created
tests/UpyunTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $config->setFormApiKey('Mv83tlocuzkmfKKUFbz2s04FzTw=');
24 24
         $config->processNotifyUrl = 'http://localhost:9999';
25 25
         self::$upyun        = new Upyun($config);
26
-        self::$tempFilePath = __DIR__ . '/assets/test.txt';
26
+        self::$tempFilePath = __DIR__.'/assets/test.txt';
27 27
         touch(self::$tempFilePath);
28 28
     }
29 29
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     public function testWriteStream()
45 45
     {
46 46
         $filename = 'test.jpeg';
47
-        $f = fopen(__DIR__ . '/assets/sample.jpeg', 'rb');
47
+        $f = fopen(__DIR__.'/assets/sample.jpeg', 'rb');
48 48
         if (!$f) {
49 49
             throw new \Exception('open test file failed!');
50 50
         }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     {
58 58
         $filename = 'test_async.jpeg';
59 59
         $newFilename = 'test_async.png';
60
-        $f = fopen(__DIR__ . '/assets/sample.jpeg', 'rb');
60
+        $f = fopen(__DIR__.'/assets/sample.jpeg', 'rb');
61 61
         if (!$f) {
62 62
             throw new \Exception('open test file failed!');
63 63
         }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         try {
82 82
             $fs->write('test.txt', 'test file content');
83 83
         } catch (\Exception $e) {
84
-            return ;
84
+            return;
85 85
         }
86 86
         throw new \Exception('should get sign error.');
87 87
     }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         try {
117 117
             self::$upyun->read('test-delete.txt');
118 118
         } catch (\Exception $e) {
119
-            return ;
119
+            return;
120 120
         }
121 121
         throw new \Exception('delete file failed');
122 122
     }
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     public function testProcess()
247 247
     {
248 248
         $source = 'php-sdk-sample.mp4';
249
-        self::$upyun->write($source, fopen(__DIR__ . '/assets/SampleVideo_640x360_1mb.mp4', 'r'));
249
+        self::$upyun->write($source, fopen(__DIR__.'/assets/SampleVideo_640x360_1mb.mp4', 'r'));
250 250
         $result = self::$upyun->process(array(
251 251
             array('type' => 'video', 'avopts' => '/s/240p(4:3)/as/1/r/30', 'return_info' => true, 'save_as' => '/video/result.mp4')
252 252
         ), Upyun::$PROCESS_TYPE_MEDIA, $source);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
     public function testAvMeta()
286 286
     {
287 287
         $source = 'php-sdk-sample.mp4';
288
-        self::$upyun->write($source, fopen(__DIR__ . '/assets/SampleVideo_640x360_1mb.mp4', 'r'));
288
+        self::$upyun->write($source, fopen(__DIR__.'/assets/SampleVideo_640x360_1mb.mp4', 'r'));
289 289
         $result = self::$upyun->avMeta('/php-sdk-sample.mp4');
290 290
         $this->assertTrue(count($result) === 2);
291 291
         $this->assertTrue($result['streams'][0]['type'] === 'video');
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
     {
296 296
         sleep(5);
297 297
         $source = 'php-sdk-sample.mp4';
298
-        self::$upyun->write($source, fopen(__DIR__ . '/assets/SampleVideo_640x360_1mb.mp4', 'r'));
298
+        self::$upyun->write($source, fopen(__DIR__.'/assets/SampleVideo_640x360_1mb.mp4', 'r'));
299 299
         $result = self::$upyun->snapshot('/php-sdk-sample.mp4', '/snapshot.jpg', '00:00:01', '720x480', 'jpg');
300 300
         $this->assertTrue($result['status_code'] === 200);
301 301
     }
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
         $config->setUploadType('BLOCK_PARALLEL');
307 307
         $upyun = new Upyun($config);
308 308
         $filename = 'test_parallel.jpeg';
309
-        $upyun->write($filename, fopen(__DIR__ . '/assets/sample.jpeg', 'rb'));
309
+        $upyun->write($filename, fopen(__DIR__.'/assets/sample.jpeg', 'rb'));
310 310
 
311 311
         $size = getUpyunFileSize($filename);
312 312
         $this->assertEquals($size, PIC_SIZE);
Please login to merge, or discard this patch.