|
@@ 129-135 (lines=7) @@
|
| 126 |
|
* |
| 127 |
|
* @return void |
| 128 |
|
*/ |
| 129 |
|
public function testVideosUserUseJson() |
| 130 |
|
{ |
| 131 |
|
$user = $this->createUser(); |
| 132 |
|
$video = $this->createFakeVideo($user); |
| 133 |
|
$this->get('/api/videos/user/'.$user->id)->seeJsonContains(['name' => $video->name, 'category' => $video->category, 'path' => $video->path]) |
| 134 |
|
->seeStatusCode(200); |
| 135 |
|
} |
| 136 |
|
|
| 137 |
|
/** |
| 138 |
|
* Test videos for category is an api then returns JSON. |
|
@@ 142-148 (lines=7) @@
|
| 139 |
|
* |
| 140 |
|
* @return void |
| 141 |
|
*/ |
| 142 |
|
public function testVideosForCategory() |
| 143 |
|
{ |
| 144 |
|
$user = $this->createUser(); |
| 145 |
|
$video = $this->createFakeVideo($user); |
| 146 |
|
$this->get('/api/videos/category/'.$video->category)->seeJsonContains(['name' => $video->name, 'category' => $video->category, 'path' => $video->path]) |
| 147 |
|
->seeStatusCode(200); |
| 148 |
|
} |
| 149 |
|
|
| 150 |
|
/** |
| 151 |
|
* Test video in database is shown by API. |
|
@@ 155-161 (lines=7) @@
|
| 152 |
|
* |
| 153 |
|
* @return void |
| 154 |
|
*/ |
| 155 |
|
public function testVideoInDatabaseAreShownByAPI() |
| 156 |
|
{ |
| 157 |
|
$user = $this->createUser(); |
| 158 |
|
$video = $this->createFakeVideo($user); |
| 159 |
|
$this->get('/api/videos/'.$video->id)->seeJsonContains(['name' => $video->name, 'category' => $video->category, 'path' => $video->path]) |
| 160 |
|
->seeStatusCode(200); |
| 161 |
|
} |
| 162 |
|
|
| 163 |
|
/** |
| 164 |
|
* Test videos Unauthorized posted without apikey. |
|
@@ 231-237 (lines=7) @@
|
| 228 |
|
* |
| 229 |
|
* @return void |
| 230 |
|
*/ |
| 231 |
|
public function testVideosCanBeSearchAndSeenResult() |
| 232 |
|
{ |
| 233 |
|
$user = $this->createUser(); |
| 234 |
|
$video = $this->createFakeVideo($user); |
| 235 |
|
$data = ['name' => $video->name, 'category' => $video->category, 'path' => $video->path]; |
| 236 |
|
$this->get('/api/videos/search/'.$video->name)->seeJson($data)->seeStatusCode(200); |
| 237 |
|
} |
| 238 |
|
} |
| 239 |
|
|