|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of Laravel SMSFactor. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Filippo Galante <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace IlGala\Tests\SMSFactor; |
|
13
|
|
|
|
|
14
|
|
|
use IlGala\SMSFactor\SMSFactor; |
|
15
|
|
|
use IlGala\SMSFactor\Connectors\ConnectionFactory as AdapterFactory; |
|
16
|
|
|
use IlGala\SMSFactor\SMSFactorFactory; |
|
17
|
|
|
use IlGala\SMSFactor\SMSFactorManager; |
|
18
|
|
|
use GrahamCampbell\TestBenchCore\ServiceProviderTrait; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* This is the service provider test class. |
|
22
|
|
|
* |
|
23
|
|
|
* @author Filippo Galante <[email protected]> |
|
24
|
|
|
*/ |
|
25
|
|
|
class ServiceProviderTest extends AbstractTestCase |
|
26
|
|
|
{ |
|
27
|
|
|
use ServiceProviderTrait; |
|
28
|
|
|
|
|
29
|
|
|
public function testAdapterFactoryIsInjectable() |
|
30
|
|
|
{ |
|
31
|
|
|
$this->assertIsInjectable(AdapterFactory::class); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
public function testSMSFactorFactoryIsInjectable() |
|
35
|
|
|
{ |
|
36
|
|
|
$this->assertIsInjectable(SMSFactorFactory::class); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
public function testSMSFactorManagerIsInjectable() |
|
40
|
|
|
{ |
|
41
|
|
|
$this->assertIsInjectable(SMSFactorManager::class); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
public function testBindings() |
|
45
|
|
|
{ |
|
46
|
|
|
$this->assertIsInjectable(SMSFactor::class); |
|
47
|
|
|
|
|
48
|
|
|
$original = $this->app['smsfactor.connection']; |
|
49
|
|
|
|
|
50
|
|
|
$this->app['smsfactor']->reconnect(); |
|
51
|
|
|
|
|
52
|
|
|
$new = $this->app['smsfactor.connection']; |
|
53
|
|
|
|
|
54
|
|
|
$this->assertNotSame($original, $new); |
|
55
|
|
|
|
|
56
|
|
|
$this->assertEquals($original, $new); |
|
57
|
|
|
} |
|
58
|
|
|
} |
|
59
|
|
|
|