|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* This file is part of the silex-annotation-provider package. |
|
4
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
5
|
|
|
* file that was distributed with this source code. |
|
6
|
|
|
* |
|
7
|
|
|
* @license MIT License |
|
8
|
|
|
* @copyright (c) 2018, Dana Desrosiers <[email protected]> |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
namespace DDesrosiers\Test\SilexAnnotations\Annotations; |
|
12
|
|
|
|
|
13
|
|
|
use DDesrosiers\Test\SilexAnnotations\AnnotationTestBase; |
|
14
|
|
|
|
|
15
|
|
|
class RequestTest extends AnnotationTestBase |
|
16
|
|
|
{ |
|
17
|
|
|
public function requestTestDataProvider() |
|
18
|
|
|
{ |
|
19
|
|
|
return array( |
|
20
|
|
|
array(self::POST_METHOD, "/test/post", self::STATUS_OK), |
|
21
|
|
|
array(self::PUT_METHOD, "/test/put", self::STATUS_OK), |
|
22
|
|
|
array(self::DELETE_METHOD, "/test/delete", self::STATUS_OK), |
|
23
|
|
|
// match tests |
|
24
|
|
|
array(self::GET_METHOD, "/test/multi-method", self::STATUS_OK), |
|
25
|
|
|
array(self::POST_METHOD, "/test/multi-method", self::STATUS_OK), |
|
26
|
|
|
array(self::GET_METHOD, "/test/match", self::STATUS_OK), |
|
27
|
|
|
array(self::POST_METHOD, "/test/match", self::STATUS_OK), |
|
28
|
|
|
); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @dataProvider requestTestDataProvider |
|
33
|
|
|
* @param $method |
|
34
|
|
|
* @param $uri |
|
35
|
|
|
* @param int $status |
|
36
|
|
|
*/ |
|
37
|
|
|
public function testRequests($method, $uri, $status=self::STATUS_OK) |
|
38
|
|
|
{ |
|
39
|
|
|
$this->assertEndPointStatus($method, $uri, $status); |
|
40
|
|
|
} |
|
41
|
|
|
} |
|
42
|
|
|
|