1 | <?php |
||
8 | class FactoryTest extends TestCase |
||
9 | { |
||
10 | |||
11 | public function providerFactoryClass() |
||
12 | { |
||
13 | return [ |
||
14 | ['Factory'], |
||
15 | ['DebugFactory'], |
||
16 | ]; |
||
17 | } |
||
18 | |||
19 | /** |
||
20 | * @dataProvider providerFactoryClass |
||
21 | * @covers Radowoj\Yaah\HelperFactory\Factory |
||
22 | * @covers Radowoj\Yaah\HelperFactory\DebugFactory |
||
23 | * @covers Radowoj\Yaah\HelperFactory\HelperFactory |
||
24 | */ |
||
25 | public function testFactoryReturnsHelper($factoryClass) |
||
26 | { |
||
27 | $class = "Radowoj\\Yaah\\HelperFactory\\{$factoryClass}"; |
||
28 | |||
29 | $factory = new $class(); |
||
30 | |||
31 | $helper = $factory->create([ |
||
32 | 'apiKey' => 'some-api-key', |
||
33 | 'login' => 'some-login', |
||
34 | 'passwordHash' => 'some-password-hash', |
||
35 | 'isSandbox' => true, |
||
36 | 'countryCode' => 1, |
||
37 | ]); |
||
38 | |||
39 | $this->assertInstanceOf('Radowoj\Yaah\Helper', $helper); |
||
40 | } |
||
41 | } |
||
42 |