|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* (c) Christian Gripp <[email protected]> |
|
5
|
|
|
* |
|
6
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
7
|
|
|
* file that was distributed with this source code. |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
namespace Core23\LastFmBundle\Tests\DependencyInjection; |
|
11
|
|
|
|
|
12
|
|
|
use Core23\LastFmBundle\DependencyInjection\Core23LastFmExtension; |
|
13
|
|
|
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase; |
|
14
|
|
|
|
|
15
|
|
|
class Core23LastFmExtensionTest extends AbstractExtensionTestCase |
|
16
|
|
|
{ |
|
17
|
|
|
public function testLoadDefault() |
|
18
|
|
|
{ |
|
19
|
|
|
$this->load(array( |
|
20
|
|
|
'api' => array( |
|
21
|
|
|
'app_id' => 'foo_id', |
|
22
|
|
|
'shared_secret' => 'bar_secret', |
|
23
|
|
|
), |
|
24
|
|
|
)); |
|
25
|
|
|
|
|
26
|
|
|
$this->assertContainerBuilderHasParameter('core23.lastfm.auth_success.redirect_route', null); |
|
27
|
|
|
$this->assertContainerBuilderHasParameter('core23.lastfm.auth_success.redirect_route_params', array()); |
|
28
|
|
|
$this->assertContainerBuilderHasParameter('core23.lastfm.auth_error.redirect_route', null); |
|
29
|
|
|
$this->assertContainerBuilderHasParameter('core23.lastfm.auth_error.redirect_route_params', array()); |
|
30
|
|
|
|
|
31
|
|
|
$this->assertContainerBuilderHasParameter('core23.lastfm.api.app_id', 'foo_id'); |
|
32
|
|
|
$this->assertContainerBuilderHasParameter('core23.lastfm.api.shared_secret', 'bar_secret'); |
|
33
|
|
|
$this->assertContainerBuilderHasParameter('core23.lastfm.api.endpoint', 'http://ws.audioscrobbler.com/2.0/'); |
|
34
|
|
|
$this->assertContainerBuilderHasParameter('core23.lastfm.api.auth_url', 'http://www.last.fm/api/auth/'); |
|
35
|
|
|
|
|
36
|
|
|
$this->assertContainerBuilderHasAlias('core23.lastfm.http.client', 'httplug.client.default'); |
|
37
|
|
|
$this->assertContainerBuilderHasAlias('core23.lastfm.http.message_factory', 'httplug.message_factory.default'); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
protected function getContainerExtensions() |
|
41
|
|
|
{ |
|
42
|
|
|
return array( |
|
43
|
|
|
new Core23LastFmExtension(), |
|
44
|
|
|
); |
|
45
|
|
|
} |
|
46
|
|
|
} |
|
47
|
|
|
|