File tree Expand file tree Collapse file tree 12 files changed +206
-21
lines changed
DependencyInjection/Source Expand file tree Collapse file tree 12 files changed +206
-21
lines changed Original file line number Diff line number Diff line change @@ -52,14 +52,6 @@ services:
5252 tags :
5353 - {name: 'console.command'}
5454
55- Jose\Component\Console\JKULoaderCommand :
56- tags :
57- - {name: 'console.command'}
58-
59- Jose\Component\Console\X5ULoaderCommand :
60- tags :
61- - {name: 'console.command'}
62-
6355 Jose\Component\Console\KeyAnalyzerCommand :
6456 tags :
6557 - {name: 'console.command'}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /*
6+ * The MIT License (MIT)
7+ *
8+ * Copyright (c) 2014-2017 Spomky-Labs
9+ *
10+ * This software may be modified and distributed under the terms
11+ * of the MIT license. See the LICENSE file for details.
12+ */
13+
14+ use Symfony \Component \Config \Loader \LoaderInterface ;
15+ use Symfony \Component \HttpKernel \Kernel ;
16+
17+ /**
18+ * Class AppKernel.
19+ */
20+ final class AppKernel extends Kernel
21+ {
22+ /**
23+ * {@inheritdoc}
24+ */
25+ public function registerBundles ()
26+ {
27+ $ bundles = [
28+ new Symfony \Bundle \FrameworkBundle \FrameworkBundle (),
29+ new Jose \Bundle \JoseFramework \JoseFrameworkBundle (),
30+ new Jose \Bundle \Console \ConsoleBundle (),
31+
32+ new Jose \Bundle \Console \Tests \TestBundle \TestBundle (),
33+ ];
34+
35+ return $ bundles ;
36+ }
37+
38+ /**
39+ * {@inheritdoc}
40+ */
41+ public function getCacheDir ()
42+ {
43+ return sys_get_temp_dir ().'/Jose/Bundle/Test ' ;
44+ }
45+
46+ /**
47+ * {@inheritdoc}
48+ */
49+ public function registerContainerConfiguration (LoaderInterface $ loader )
50+ {
51+ $ loader ->load (__DIR__ .'/config/config_ ' .$ this ->getEnvironment ().'.yml ' );
52+ }
53+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /*
6+ * The MIT License (MIT)
7+ *
8+ * Copyright (c) 2014-2017 Spomky-Labs
9+ *
10+ * This software may be modified and distributed under the terms
11+ * of the MIT license. See the LICENSE file for details.
12+ */
13+
14+ namespace Jose \Bundle \Console \Tests ;
15+
16+ use Symfony \Bundle \FrameworkBundle \Console \Application ;
17+ use Symfony \Bundle \FrameworkBundle \Test \KernelTestCase ;
18+
19+ /**
20+ * @group Bundle
21+ * @group Functional
22+ */
23+ final class ConsoleTest extends KernelTestCase
24+ {
25+ public function testAllCommandsAreAvailable ()
26+ {
27+ $ expectedCommands = [
28+ 'keyset:add:key ' ,
29+ 'key:generate:ec ' ,
30+ 'keyset:generate:ec ' ,
31+ 'key:thumbprint ' ,
32+ 'key:analyze ' ,
33+ 'key:load:key ' ,
34+ 'keyset:analyze ' ,
35+ 'keyset:merge ' ,
36+ 'key:generate:oct ' ,
37+ 'keyset:generate:oct ' ,
38+ 'key:generate:okp ' ,
39+ 'keyset:generate:okp ' ,
40+ 'key:optimize ' ,
41+ 'key:load:p12 ' ,
42+ 'key:convert:pkcs1 ' ,
43+ 'keyset:convert:public ' ,
44+ 'keyset:rotate ' ,
45+ 'key:generate:rsa ' ,
46+ 'keyset:generate:rsa ' ,
47+ 'key:load:x509 '
48+ ];
49+ self ::bootKernel ();
50+ $ application = new Application (self ::$ kernel );
51+
52+ self ::assertEmpty (array_diff ($ expectedCommands , array_keys ($ application ->all ())));
53+ }
54+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /*
6+ * The MIT License (MIT)
7+ *
8+ * Copyright (c) 2014-2017 Spomky-Labs
9+ *
10+ * This software may be modified and distributed under the terms
11+ * of the MIT license. See the LICENSE file for details.
12+ */
13+
14+ namespace Jose \Bundle \Console \Tests \TestBundle \DependencyInjection ;
15+
16+ use Symfony \Component \Config \FileLocator ;
17+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
18+ use Symfony \Component \DependencyInjection \Loader \YamlFileLoader ;
19+ use Symfony \Component \HttpKernel \DependencyInjection \Extension ;
20+
21+ /**
22+ * Class TestExtension.
23+ */
24+ final class TestExtension extends Extension
25+ {
26+ /**
27+ * {@inheritdoc}
28+ */
29+ public function load (array $ configs , ContainerBuilder $ container )
30+ {
31+ $ loader = new YamlFileLoader ($ container , new FileLocator (__DIR__ .'/../Resources/config ' ));
32+ $ loader ->load ('services.yml ' );
33+ }
34+ }
Original file line number Diff line number Diff line change 1+ services :
2+ _defaults :
3+ autowire : true
4+ autoconfigure : true
5+ public : true
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /*
6+ * The MIT License (MIT)
7+ *
8+ * Copyright (c) 2014-2017 Spomky-Labs
9+ *
10+ * This software may be modified and distributed under the terms
11+ * of the MIT license. See the LICENSE file for details.
12+ */
13+
14+ namespace Jose \Bundle \Console \Tests \TestBundle ;
15+
16+ use Symfony \Component \HttpKernel \Bundle \Bundle ;
17+
18+ /**
19+ * Class TestBundle.
20+ */
21+ final class TestBundle extends Bundle
22+ {
23+ }
Original file line number Diff line number Diff line change 1+ framework :
2+ test : ~
3+ secret : test
4+ session :
5+ storage_id : session.storage.mock_file
6+ router :
7+ resource : " %kernel.root_dir%/config/routing.yml"
8+ strict_requirements : ~
9+ fragments : ~
10+ http_method_override : true
Original file line number Diff line number Diff line change 2727 "web-token/jwt-key-mgmt" : " ^1.0@dev"
2828 },
2929 "require-dev" : {
30+ "symfony/framework-bundle" : " ^3.3" ,
31+ "symfony/yaml" : " ^3.3" ,
32+ "symfony/browser-kit" : " ^3.3" ,
3033 "phpunit/phpunit" : " ^6.0"
3134 },
3235 "extra" : {
Original file line number Diff line number Diff line change 1515 <directory >./Tests/</directory >
1616 </testsuite >
1717 </testsuites >
18-
18+ <php >
19+ <ini name =" error_reporting" value =" -1" />
20+ <server name =" KERNEL_DIR" value =" ./Tests/" />
21+ </php >
1922 <filter >
2023 <whitelist >
2124 <directory suffix =" .php" >./</directory >
You can’t perform that action at this time.
0 commit comments