aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ImportBundle/Import/ImportCompilerPassTest.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-06-23 11:47:46 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-06-23 11:47:46 +0200
commitf49d9ca383c9f8a1bc426cfabf6b1cea53ea26b4 (patch)
tree156b1a29cfbe1962e68d409c3dea5a3911a34e9c /tests/Wallabag/ImportBundle/Import/ImportCompilerPassTest.php
parent49e2854d5c15bbce3f24f91da34450e8f209295b (diff)
parentfb5c17a9ab5e10b1de9caa50e73638fdae19cb78 (diff)
downloadwallabag-f49d9ca383c9f8a1bc426cfabf6b1cea53ea26b4.tar.gz
wallabag-f49d9ca383c9f8a1bc426cfabf6b1cea53ea26b4.tar.zst
wallabag-f49d9ca383c9f8a1bc426cfabf6b1cea53ea26b4.zip
Merge branch 'master' into 2.1
Diffstat (limited to 'tests/Wallabag/ImportBundle/Import/ImportCompilerPassTest.php')
-rw-r--r--tests/Wallabag/ImportBundle/Import/ImportCompilerPassTest.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/Wallabag/ImportBundle/Import/ImportCompilerPassTest.php b/tests/Wallabag/ImportBundle/Import/ImportCompilerPassTest.php
new file mode 100644
index 00000000..71a007a9
--- /dev/null
+++ b/tests/Wallabag/ImportBundle/Import/ImportCompilerPassTest.php
@@ -0,0 +1,47 @@
1<?php
2
3namespace Tests\Wallabag\ImportBundle\Import;
4
5use Symfony\Component\DependencyInjection\ContainerBuilder;
6use Wallabag\ImportBundle\Import\ImportCompilerPass;
7
8class ImportCompilerPassTest extends \PHPUnit_Framework_TestCase
9{
10 public function testProcessNoDefinition()
11 {
12 $container = new ContainerBuilder();
13 $res = $this->process($container);
14
15 $this->assertNull($res);
16 }
17
18 public function testProcess()
19 {
20 $container = new ContainerBuilder();
21 $container
22 ->register('wallabag_import.chain')
23 ->setPublic(false)
24 ;
25
26 $container
27 ->register('foo')
28 ->addTag('wallabag_import.import', ['alias' => 'pocket'])
29 ;
30
31 $this->process($container);
32
33 $this->assertTrue($container->hasDefinition('wallabag_import.chain'));
34
35 $definition = $container->getDefinition('wallabag_import.chain');
36 $this->assertTrue($definition->hasMethodCall('addImport'));
37
38 $calls = $definition->getMethodCalls();
39 $this->assertEquals('pocket', $calls[0][1][1]);
40 }
41
42 protected function process(ContainerBuilder $container)
43 {
44 $repeatedPass = new ImportCompilerPass();
45 $repeatedPass->process($container);
46 }
47}