This repository was archived by the owner on Jan 21, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +93
-1
lines changed Expand file tree Collapse file tree 4 files changed +93
-1
lines changed Original file line number Diff line number Diff line change 55
55
"dev-master" : " 1.4.x-dev" ,
56
56
"dev-develop" : " 1.5.x-dev" ,
57
57
"dev-release-2.0.0" : " 2.0.x-dev"
58
+ },
59
+ "zf" : {
60
+ "config-provider" : " Zend\\ Expressive\\ ZendView\\ ConfigProvider"
58
61
}
59
62
},
60
63
"scripts" : {
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @see https://github.com/zendframework/zend-expressive-zendviewrenderer for the canonical source repository
4
+ * @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com)
5
+ * @license https://github.com/zendframework/zend-expressive-zendviewrenderer/blob/master/LICENSE.md New BSD License
6
+ */
7
+
8
+ declare (strict_types=1 );
9
+
10
+ namespace Zend \Expressive \ZendView ;
11
+
12
+ use Zend \Expressive \Template \TemplateRendererInterface ;
13
+ use Zend \View \HelperPluginManager ;
14
+
15
+ class ConfigProvider
16
+ {
17
+ public function __invoke () : array
18
+ {
19
+ return [
20
+ 'dependencies ' => $ this ->getDependencies (),
21
+ 'templates ' => $ this ->getTemplates (),
22
+ ];
23
+ }
24
+
25
+ public function getDependencies () : array
26
+ {
27
+ return [
28
+ 'aliases ' => [
29
+ TemplateRendererInterface::class => ZendViewRenderer::class,
30
+ ],
31
+ 'factories ' => [
32
+ HelperPluginManager::class => HelperPluginManagerFactory::class,
33
+ ZendViewRenderer::class => ZendViewRendererFactory::class,
34
+ ],
35
+ ];
36
+ }
37
+
38
+ public function getTemplates () : array
39
+ {
40
+ return [
41
+ 'extension ' => 'phtml ' ,
42
+ 'paths ' => [],
43
+ ];
44
+ }
45
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @see https://github.com/zendframework/zend-expressive-zendviewrenderer for the canonical source repository
4
+ * @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com)
5
+ * @license https://github.com/zendframework/zend-expressive-zendviewrenderer/blob/master/LICENSE.md New BSD License
6
+ */
7
+
8
+ declare (strict_types=1 );
9
+
10
+ namespace ZendTest \Expressive \ZendView ;
11
+
12
+ use PHPUnit \Framework \TestCase ;
13
+ use Zend \Expressive \ZendView \ConfigProvider ;
14
+
15
+ class ConfigProviderTest extends TestCase
16
+ {
17
+ /**
18
+ * @var ConfigProvider
19
+ */
20
+ private $ provider ;
21
+
22
+ protected function setUp () : void
23
+ {
24
+ $ this ->provider = new ConfigProvider ();
25
+ }
26
+
27
+ public function testInvocationReturnsArray () : array
28
+ {
29
+ $ config = ($ this ->provider )();
30
+ self ::assertInternalType ('array ' , $ config );
31
+
32
+ return $ config ;
33
+ }
34
+
35
+ /**
36
+ * @depends testInvocationReturnsArray
37
+ */
38
+ public function testReturnedArrayContainsDependencies (array $ config ) : void
39
+ {
40
+ self ::assertArrayHasKey ('dependencies ' , $ config );
41
+ self ::assertArrayHasKey ('templates ' , $ config );
42
+ self ::assertInternalType ('array ' , $ config ['dependencies ' ]);
43
+ }
44
+ }
You can’t perform that action at this time.
0 commit comments