-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathJsLocalizationServiceProviderTest.php
54 lines (41 loc) · 1.68 KB
/
JsLocalizationServiceProviderTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
use JsLocalization\JsLocalizationServiceProvider;
use JsLocalization\Console\RefreshCommand;
use Symfony\Component\Console\Tester\CommandTester;
class JsLocalizationServiceProviderTest extends Orchestra\Testbench\TestCase
{
protected function getPackageProviders()
{
return array('JsLocalization\JsLocalizationServiceProvider');
}
public function testProvidesArray () {
$service = new JsLocalization\JsLocalizationServiceProvider($this->app);
$this->assertEquals( $service->provides(), array('js-localization') );
}
public function testRegisteredNamespaces ()
{
$this->assertArrayHasKey(
'js-localization', Config::getNamespaces(),
'Configuration namespace not registered: js-localization'
);
$this->assertArrayHasKey(
'js-localization', View::getFinder()->getHints(),
'View namespace not registered: js-localization'
);
}
public function testRegisteredCommands ()
{
$refreshCommand = Artisan::find('js-localization:refresh');
$this->assertInstanceOf('JsLocalization\Console\RefreshCommand', $refreshCommand);
$commandTester = new CommandTester($refreshCommand);
$commandTester->execute(array());
$this->assertEquals("Refreshing the message cache...\n", $commandTester->getDisplay());
}
public function testBindings ()
{
$helper = App::make('JsLocalizationHelper');
$this->assertInstanceOf('JsLocalization\Helper', $helper);
$cachingService = App::make('JsLocalizationCachingService');
$this->assertInstanceOf('JsLocalization\CachingService', $cachingService);
}
}