@@ -30,6 +30,9 @@ public function setUp()
3030 ],
3131 'arguments ' => [
3232 'format ' => 'pdf '
33+ ],
34+ 'env_vars ' => [
35+ 'NODE_PATH ' => '/usr/local/lib/node_modules ' ,
3336 ]
3437 ];
3538 }
@@ -48,5 +51,32 @@ public function isTheProcessBuilt()
4851 implode (DIRECTORY_SEPARATOR , ['node ' . __DIR__ , 'assets ' , 'rasterize.js ' ]) . ' pdf ' ,
4952 str_replace (['" ' , "' " ], '' , $ process ->getCommandLine ())
5053 );
54+
55+ $ this ->assertCount (1 , $ process ->getEnv ());
56+ }
57+
58+ /**
59+ * @test
60+ */
61+ public function attributeMerge ()
62+ {
63+ $ configHelper = new ConfigHelper (__DIR__ , $ this ->config );
64+ $ process = $ configHelper ->buildProcess (new InputStream (), ['paper ' => 'A4 ' ]);
65+
66+ $ this ->assertEquals (
67+ implode (DIRECTORY_SEPARATOR , ['node ' . __DIR__ , 'assets ' , 'rasterize.js ' ]) . ' pdf A4 ' ,
68+ str_replace (['" ' , "' " ], '' , $ process ->getCommandLine ())
69+ );
70+ }
71+
72+ /**
73+ * @test
74+ */
75+ public function envMerge ()
76+ {
77+ $ configHelper = new ConfigHelper (__DIR__ , $ this ->config );
78+ $ process = $ configHelper ->buildProcess (new InputStream (), [], ['MY_ENV ' => 'something ' ]);
79+
80+ $ this ->assertCount (2 , $ process ->getEnv ());
5181 }
5282}
0 commit comments