Passed
Pull Request — master (#54)
by
unknown
10:38
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
     }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     public function testProcess()
219 219
     {
220 220
         $source = 'php-sdk-sample.mp4';
221
-        self::$upyun->write($source, fopen(__DIR__ . '/assets/SampleVideo_640x360_1mb.mp4', 'r'));
221
+        self::$upyun->write($source, fopen(__DIR__.'/assets/SampleVideo_640x360_1mb.mp4', 'r'));
222 222
         $result = self::$upyun->process(array(
223 223
             array('type' => 'video', 'avopts' => '/s/240p(4:3)/as/1/r/30', 'return_info' => true, 'save_as' => '/video/result.mp4')
224 224
         ), Upyun::$PROCESS_TYPE_MEDIA, $source);
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     public function testAvMeta()
258 258
     {
259 259
         $source = 'php-sdk-sample.mp4';
260
-        self::$upyun->write($source, fopen(__DIR__ . '/assets/SampleVideo_640x360_1mb.mp4', 'r'));
260
+        self::$upyun->write($source, fopen(__DIR__.'/assets/SampleVideo_640x360_1mb.mp4', 'r'));
261 261
         $result = self::$upyun->avMeta('/php-sdk-sample.mp4');
262 262
         $this->assertTrue(count($result) === 2);
263 263
         $this->assertTrue($result['streams'][0]['type'] === 'video');
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
     public function testSnapshot()
267 267
     {
268 268
         $source = 'php-sdk-sample.mp4';
269
-        self::$upyun->write($source, fopen(__DIR__ . '/assets/SampleVideo_640x360_1mb.mp4', 'r'));
269
+        self::$upyun->write($source, fopen(__DIR__.'/assets/SampleVideo_640x360_1mb.mp4', 'r'));
270 270
         $result = self::$upyun->snapshot('/php-sdk-sample.mp4', '/snapshot.jpg', '00:00:01', '720x480', 'jpg');
271 271
         $this->assertTrue($result['status_code'] === 200);
272 272
     }
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         $config->setUploadType('BLOCK_PARALLEL');
278 278
         $upyun = new Upyun($config);
279 279
         $filename = 'test_parallel.jpeg';
280
-        $upyun->write($filename, fopen(__DIR__ . '/assets/sample.jpeg', 'rb'));
280
+        $upyun->write($filename, fopen(__DIR__.'/assets/sample.jpeg', 'rb'));
281 281
 
282 282
         $size = getUpyunFileSize($filename);
283 283
         $this->assertEquals($size, PIC_SIZE);
Please login to merge, or discard this patch.