1 | <?php |
||
36 | class FakerTest extends UnitTestCase |
||
37 | { |
||
38 | /** |
||
39 | * @var Faker $subject |
||
40 | */ |
||
41 | protected $subject; |
||
42 | |||
43 | protected function setUp() |
||
51 | |||
52 | protected function tearDown() |
||
56 | |||
57 | /** |
||
58 | * @method guessProviderName |
||
59 | * @test |
||
60 | * @throws \TildBJ\Seeder\Provider\NotFoundException |
||
61 | */ |
||
62 | public function guessProviderNameByKeyWithEmptyArgumentThrowsNotFoundException() |
||
69 | |||
70 | /** |
||
71 | * @method guessProviderName |
||
72 | * @test |
||
73 | * @throws \TildBJ\Seeder\Provider\NotFoundException |
||
74 | */ |
||
75 | public function guessProviderNameReturnsProvidername() |
||
79 | |||
80 | /** |
||
81 | * @method guessProviderNameByKey |
||
82 | * @test |
||
83 | * @throws \TildBJ\Seeder\Provider\NotFoundException |
||
84 | */ |
||
85 | public function guessProviderNameByKeyReturnsNullIfNotFound() |
||
89 | |||
90 | /** |
||
91 | * @method get |
||
92 | * @test |
||
93 | * @throws \TildBJ\Seeder\Provider\NotFoundException |
||
94 | */ |
||
95 | public function getThrowsExceptionIfNoProviderWasFound() |
||
100 | |||
101 | /** |
||
102 | * @method get |
||
103 | * @test |
||
104 | * @throws \TildBJ\Seeder\Provider\NotFoundException |
||
105 | */ |
||
106 | public function getZipReturnsPostcode() |
||
110 | |||
111 | /** |
||
112 | * @method get |
||
113 | * @test |
||
114 | * @throws \TildBJ\Seeder\Provider\NotFoundException |
||
115 | */ |
||
116 | public function getPostcodeReturnsPostcode() |
||
120 | |||
121 | /** |
||
122 | * @method get |
||
123 | * @test |
||
124 | * @throws \TildBJ\Seeder\Provider\NotFoundException |
||
125 | */ |
||
126 | public function getPostcodeWithUnderscoreReturnsPostcode() |
||
130 | |||
131 | /** |
||
132 | * @method get |
||
133 | * @test |
||
134 | * @throws \TildBJ\Seeder\Provider\NotFoundException |
||
135 | */ |
||
136 | public function getPostcodeWithWeiredCaseReturnsPostcode() |
||
140 | |||
141 | /** |
||
142 | * @method get |
||
143 | * @test |
||
144 | * @throws \TildBJ\Seeder\Provider\NotFoundException |
||
145 | */ |
||
146 | public function getPostcodeWithUpperCaseReturnsPostcode() |
||
150 | |||
151 | /** |
||
152 | * @method get |
||
153 | * @test |
||
154 | * @throws \TildBJ\Seeder\Provider\NotFoundException |
||
155 | */ |
||
156 | public function guessProviderNameReturnsNullWithSkippedFieldName() |
||
161 | |||
162 | /** |
||
163 | * @method __call |
||
164 | * @test |
||
165 | */ |
||
166 | public function returnCustomDataIfCustomProviderIsAvailable() |
||
170 | } |
||
171 |
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: