File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,25 @@ public function it_can_build_a_client_to_make_calls()
3232 );
3333 }
3434
35+ /**
36+ * @test
37+ */
38+ public function it_can_make_a_client ()
39+ {
40+ $ client = Client::make (
41+ url: config ('companies-house.api.url ' ),
42+ apiKey: config ('companies-house.api.key ' ),
43+ timeout: (int ) config ('companies-house.api.timeout ' ),
44+ retryTimes: (int ) config ('companies-house.api.retry.times ' ),
45+ retryMilliseconds: (int ) config ('companies-house.api.retry.milliseconds ' ),
46+ );
47+
48+ $ this ->assertInstanceOf (
49+ expected: Client::class,
50+ actual: $ client ,
51+ );
52+ }
53+
3554 /**
3655 * @test
3756 */
@@ -172,12 +191,19 @@ public function it_fails_when_using_the_rule_macro()
172191 {
173192 $ number = 'quite_obviously_fake ' ;
174193
194+ $ rule = Rule::companyNumber ();
195+
175196 $ this ->assertFalse (
176- condition: Rule:: companyNumber () ->passes (
197+ condition: $ rule ->passes (
177198 attributes: 'test ' ,
178199 value: $ number ,
179200 ),
180201 );
202+
203+ $ this ->assertEquals (
204+ expected: 'The submitted company number is not a valid UK company number. ' ,
205+ actual: $ rule ->message (),
206+ );
181207 }
182208
183209 /**
You can’t perform that action at this time.
0 commit comments