File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+ /*
3+ * This file is part of the brainbits transcoder bundle package.
4+ *
5+ * (c) brainbits GmbH
6+ *
7+ * For the full copyright and license information, please view the LICENSE
8+ * file that was distributed with this source code.
9+ */
10+
11+ namespace Brainbits \TranscoderBundle \Tests ;
12+
13+ use Brainbits \TranscoderBundle \BrainbitsTranscoderBundle ;
14+ use Brainbits \TranscoderBundle \DependencyInjection \Compiler \AddDecoderPass ;
15+ use Brainbits \TranscoderBundle \DependencyInjection \Compiler \AddEncoderPass ;
16+ use Prophecy \Argument ;
17+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
18+
19+ /**
20+ * Transcoder bundle test
21+ *
22+ * @author Stephan Wentz <swentz@brainbits.net>
23+ */
24+ class BrainbitsTranscoderBundleTest extends \PHPUnit_Framework_TestCase
25+ {
26+ public function testBuild ()
27+ {
28+ $ bundle = new BrainbitsTranscoderBundle ();
29+
30+ $ container = $ this ->prophesize (ContainerBuilder::class);
31+ $ container ->addCompilerPass (Argument::type (AddDecoderPass::class))->shouldBeCalled ();
32+ $ container ->addCompilerPass (Argument::type (AddEncoderPass::class))->shouldBeCalled ();
33+
34+ $ bundle ->build ($ container ->reveal ());
35+ }
36+ }
Original file line number Diff line number Diff line change 1313use Brainbits \TranscoderBundle \DependencyInjection \BrainbitsTranscoderExtension ;
1414use Matthias \SymfonyDependencyInjectionTest \PhpUnit \AbstractExtensionTestCase ;
1515
16+ /**
17+ * Extension test
18+ *
19+ * @author Stephan Wentz <swentz@brainbits.net>
20+ */
1621class BrainbitsTranscoderExtensionTest extends AbstractExtensionTestCase
1722{
1823 protected function getContainerExtensions ()
Original file line number Diff line number Diff line change 1616use Symfony \Component \DependencyInjection \Definition ;
1717use Symfony \Component \DependencyInjection \Reference ;
1818
19+ /**
20+ * Add decoder pass test
21+ *
22+ * @author Stephan Wentz <swentz@brainbits.net>
23+ */
1924class AddDecoderPassTest extends TestCase
2025{
26+ public function testProcessWithoutDefinition ()
27+ {
28+ $ pass = new AddDecoderPass ();
29+
30+ $ definition = new Definition (null , array (null ));
31+
32+ $ container = $ this ->prophesize (ContainerBuilder::class);
33+ $ container ->hasDefinition ('brainbits.transcoder.decoder.resolver ' )->willReturn (false );
34+ $ container ->findTaggedServiceIds ('transcoder.decoder ' )->shouldNotBeCalled ();
35+ $ container ->getDefinition ('brainbits.transcoder.decoder.resolver ' )->shouldNotBeCalled ();
36+
37+ $ pass ->process ($ container ->reveal ());
38+
39+ $ this ->assertNull ($ definition ->getArgument (0 )[0 ]);
40+ }
41+
2142 public function testProcess ()
2243 {
2344 $ pass = new AddDecoderPass ();
Original file line number Diff line number Diff line change 1616use Symfony \Component \DependencyInjection \Definition ;
1717use Symfony \Component \DependencyInjection \Reference ;
1818
19+ /**
20+ * Add encoder pass test
21+ *
22+ * @author Stephan Wentz <swentz@brainbits.net>
23+ */
1924class AddEncoderPassTest extends TestCase
2025{
26+ public function testProcessWithoutDefinition ()
27+ {
28+ $ pass = new AddEncoderPass ();
29+
30+ $ definition = new Definition (null , array (null ));
31+
32+ $ container = $ this ->prophesize (ContainerBuilder::class);
33+ $ container ->hasDefinition ('brainbits.transcoder.encoder.resolver ' )->willReturn (false );
34+ $ container ->findTaggedServiceIds ('transcoder.encoder ' )->shouldNotBeCalled ();
35+ $ container ->getDefinition ('brainbits.transcoder.encoder.resolver ' )->shouldNotBeCalled ();
36+
37+ $ pass ->process ($ container ->reveal ());
38+
39+ $ this ->assertNull ($ definition ->getArgument (0 )[0 ]);
40+ }
41+
2142 public function testProcess ()
2243 {
2344 $ pass = new AddEncoderPass ();
Original file line number Diff line number Diff line change 1313use Brainbits \TranscoderBundle \DependencyInjection \Configuration ;
1414use Matthias \SymfonyConfigTest \PhpUnit \AbstractConfigurationTestCase ;
1515
16+ /**
17+ * Configuration test
18+ *
19+ * @author Stephan Wentz <swentz@brainbits.net>
20+ */
1621class ConfigurationTest extends AbstractConfigurationTestCase
1722{
1823 protected function getConfiguration ()
You can’t perform that action at this time.
0 commit comments