|
@@ 171-187 (lines=17) @@
|
| 168 |
|
$this->assertEquals($expectedParams, $params); |
| 169 |
|
} |
| 170 |
|
|
| 171 |
|
public function testAFileCanBeAddedToParams() |
| 172 |
|
{ |
| 173 |
|
$myFile = new File(__DIR__ . '/foo.txt'); |
| 174 |
|
$params = [ |
| 175 |
|
'name' => 'Foo Bar', |
| 176 |
|
'source' => $myFile, |
| 177 |
|
]; |
| 178 |
|
$app = new Application('123', 'foo_secret'); |
| 179 |
|
$request = new Request($app, 'foo_token', 'POST', '/foo/photos', $params); |
| 180 |
|
|
| 181 |
|
$actualParams = $request->getParams(); |
| 182 |
|
|
| 183 |
|
$this->assertTrue($request->containsFileUploads()); |
| 184 |
|
$this->assertFalse($request->containsVideoUploads()); |
| 185 |
|
$this->assertFalse(isset($actualParams['source'])); |
| 186 |
|
$this->assertEquals('Foo Bar', $actualParams['name']); |
| 187 |
|
} |
| 188 |
|
|
| 189 |
|
public function testAVideoCanBeAddedToParams() |
| 190 |
|
{ |
|
@@ 189-205 (lines=17) @@
|
| 186 |
|
$this->assertEquals('Foo Bar', $actualParams['name']); |
| 187 |
|
} |
| 188 |
|
|
| 189 |
|
public function testAVideoCanBeAddedToParams() |
| 190 |
|
{ |
| 191 |
|
$myFile = new Video(__DIR__ . '/foo.txt'); |
| 192 |
|
$params = [ |
| 193 |
|
'name' => 'Foo Bar', |
| 194 |
|
'source' => $myFile, |
| 195 |
|
]; |
| 196 |
|
$app = new Application('123', 'foo_secret'); |
| 197 |
|
$request = new Request($app, 'foo_token', 'POST', '/foo/videos', $params); |
| 198 |
|
|
| 199 |
|
$actualParams = $request->getParams(); |
| 200 |
|
|
| 201 |
|
$this->assertTrue($request->containsFileUploads()); |
| 202 |
|
$this->assertTrue($request->containsVideoUploads()); |
| 203 |
|
$this->assertFalse(isset($actualParams['source'])); |
| 204 |
|
$this->assertEquals('Foo Bar', $actualParams['name']); |
| 205 |
|
} |
| 206 |
|
} |
| 207 |
|
|