1 | <?php |
||
15 | class ProjectsApiTest extends \PHPUnit_Framework_TestCase |
||
16 | { |
||
17 | /** @var \Onesky\Api\Client $api */ |
||
18 | protected $api; |
||
19 | |||
20 | public function setUp() |
||
24 | |||
25 | /** |
||
26 | * @expectedException \InvalidArgumentException |
||
27 | * @expectedExceptionMessage Invalid resource action |
||
28 | */ |
||
29 | public function testProjectsDetectMissingResourceAction() |
||
33 | |||
34 | /** |
||
35 | * @expectedException \InvalidArgumentException |
||
36 | * @expectedExceptionMessage Missing parameter: project_group_id |
||
37 | */ |
||
38 | public function testProjectsListDetectMissingGroupIdParam() |
||
42 | |||
43 | /** |
||
44 | * @expectedException \UnexpectedValueException |
||
45 | * @expectedExceptionMessage Invalid authenticate data of api key or secret |
||
46 | */ |
||
47 | public function testProjectsListDetectInvalidAuthentication() |
||
51 | |||
52 | |||
53 | /** |
||
54 | * @expectedException \InvalidArgumentException |
||
55 | * @expectedExceptionMessage Missing parameter: project_id |
||
56 | */ |
||
57 | public function testProjectsShowDetectMissingParam() |
||
61 | |||
62 | /** |
||
63 | * @expectedException \UnexpectedValueException |
||
64 | * @expectedExceptionMessage Invalid authenticate data of api key or secret |
||
65 | */ |
||
66 | public function testProjectsShowDetectInvalidAuthentication() |
||
70 | |||
71 | /** |
||
72 | * @expectedException \InvalidArgumentException |
||
73 | * @expectedExceptionMessage Missing parameter: project_group_id |
||
74 | */ |
||
75 | public function testProjectsCreateDetectMissingGroupIdParam() |
||
79 | |||
80 | /** |
||
81 | * @expectedException \UnexpectedValueException |
||
82 | * @expectedExceptionMessage Invalid authenticate data of api key or secret |
||
83 | */ |
||
84 | public function testProjectsCreateDetectMissingParam() |
||
88 | |||
89 | /** |
||
90 | * @expectedException \InvalidArgumentException |
||
91 | * @expectedExceptionMessage Missing parameter: project_id |
||
92 | */ |
||
93 | public function testProjectsUpdateDetectMissingParam() |
||
97 | |||
98 | /** |
||
99 | * @expectedException \UnexpectedValueException |
||
100 | * @expectedExceptionMessage Invalid authenticate data of api key or secret |
||
101 | */ |
||
102 | public function testProjectsUpdateDetectInvalidAuthentication() |
||
106 | |||
107 | /** |
||
108 | * @expectedException \InvalidArgumentException |
||
109 | * @expectedExceptionMessage Missing parameter: project_id |
||
110 | */ |
||
111 | public function testProjectsDeleteDetectMissingParam() |
||
115 | |||
116 | /** |
||
117 | * @expectedException \UnexpectedValueException |
||
118 | * @expectedExceptionMessage Invalid authenticate data of api key or secret |
||
119 | */ |
||
120 | public function testProjectsDeleteDetectInvalidAuthentication() |
||
124 | |||
125 | /** |
||
126 | * @expectedException \InvalidArgumentException |
||
127 | * @expectedExceptionMessage Missing parameter: project_id |
||
128 | */ |
||
129 | public function testProjectsLanguagesDetectMissingParam() |
||
133 | |||
134 | /** |
||
135 | * @expectedException \UnexpectedValueException |
||
136 | * @expectedExceptionMessage Invalid authenticate data of api key or secret |
||
137 | */ |
||
138 | public function testProjectsLanguagesDetectInvalidAuthentication() |
||
142 | } |
||
143 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: