6
6
use Illuminate \Http \UploadedFile ;
7
7
use PHPUnit \Framework \TestCase ;
8
8
use Pion \Laravel \ChunkUpload \Config \FileConfig ;
9
+ use Pion \Laravel \ChunkUpload \Exceptions \ChunkInvalidValueException ;
9
10
use Pion \Laravel \ChunkUpload \Handler \NgFileUploadHandler ;
10
11
11
12
class NgFileUploadHandlerTest extends TestCase
12
13
{
13
- /**
14
- * @throws \Exception
15
- */
16
14
public function testInitWithoutChunk ()
17
15
{
18
16
$ request = Request::create ('test ' , 'POST ' , [], [], [], []);
@@ -24,9 +22,6 @@ public function testInitWithoutChunk()
24
22
$ this ->assertFalse ($ ngFileUpload ->isChunkedUpload ());
25
23
}
26
24
27
- /**
28
- * @throws \Exception
29
- */
30
25
public function testInitWithChunk ()
31
26
{
32
27
$ request = Request::create (
@@ -47,9 +42,6 @@ public function testInitWithChunk()
47
42
$ this ->assertTrue ($ ngFileUpload ->isChunkedUpload ());
48
43
}
49
44
50
- /**
51
- * @throws \Exception
52
- */
53
45
public function testPercentageDoneWithoutChunk ()
54
46
{
55
47
$ request = Request::create ('test ' , 'POST ' , [], [], [], []);
@@ -61,9 +53,6 @@ public function testPercentageDoneWithoutChunk()
61
53
$ this ->assertEquals (0 , $ ngFileUpload ->getPercentageDone ());
62
54
}
63
55
64
- /**
65
- * @throws \Exception
66
- */
67
56
public function testValidNgFileUploadFirstChunk ()
68
57
{
69
58
$ request = Request::create (
@@ -88,9 +77,6 @@ public function testValidNgFileUploadFirstChunk()
88
77
$ this ->assertTrue ($ ngFileUpload ->isFirstChunk ());
89
78
}
90
79
91
- /**
92
- * @throws \Exception
93
- */
94
80
public function testValidNgFileUploadNextChunk ()
95
81
{
96
82
$ request = Request::create (
@@ -116,9 +102,6 @@ public function testValidNgFileUploadNextChunk()
116
102
$ this ->assertFalse ($ ngFileUpload ->isFirstChunk ());
117
103
}
118
104
119
- /**
120
- * @throws \Exception
121
- */
122
105
public function testIsLastChunk ()
123
106
{
124
107
$ request = Request::create (
@@ -146,7 +129,7 @@ public function testIsLastChunk()
146
129
/**
147
130
* Checks if canBeUsedForRequest returns false when chunk is missing.
148
131
*
149
- * @throws \Exception
132
+ * @throws ChunkInvalidValueException
150
133
*/
151
134
public function testCanBeUsedForInvalidRequest ()
152
135
{
@@ -157,7 +140,7 @@ public function testCanBeUsedForInvalidRequest()
157
140
/**
158
141
* Checks if canBeUsedForRequest returns false when content-range is invalid.
159
142
*
160
- * @throws \Exception
143
+ * @throws ChunkInvalidValueException
161
144
*/
162
145
public function testCanBeUsedForInvalidContentRangeFormat ()
163
146
{
@@ -177,7 +160,7 @@ public function testCanBeUsedForInvalidContentRangeFormat()
177
160
/**
178
161
* Checks if canBeUsedForRequest returns false when content-range is missing.
179
162
*
180
- * @throws \Exception
163
+ * @throws ChunkInvalidValueException
181
164
*/
182
165
public function testCanBeUsedForValidRange ()
183
166
{
0 commit comments