@@ -795,6 +795,37 @@ public function testAssertingThatNothingRan()
795795 $ factory ->assertNothingRan ();
796796 }
797797
798+  public  function  testProcessWithMultipleEnvironmentVariablesAndSequences ()
799+  {
800+  $ factory  = new  Factory ;
801+ 
802+  $ factory ->fake ([
803+  'printenv TEST_VAR OTHER_VAR '  => $ factory ->sequence ()
804+  ->push ("test_value \nother_value " )
805+  ->push ("new_test_value \nnew_other_value " ),
806+  ]);
807+ 
808+  $ result  = $ factory ->env ([
809+  'TEST_VAR '  => 'test_value ' ,
810+  'OTHER_VAR '  => 'other_value ' ,
811+  ])->run ('printenv TEST_VAR OTHER_VAR ' );
812+ 
813+  $ this  ->assertTrue ($ result ->successful ());
814+  $ this  ->assertEquals ("test_value \nother_value \n" , $ result ->output ());
815+ 
816+  $ result  = $ factory ->env ([
817+  'TEST_VAR '  => 'new_test_value ' ,
818+  'OTHER_VAR '  => 'new_other_value ' ,
819+  ])->run ('printenv TEST_VAR OTHER_VAR ' );
820+ 
821+  $ this  ->assertTrue ($ result ->successful ());
822+  $ this  ->assertEquals ("new_test_value \nnew_other_value \n" , $ result ->output ());
823+ 
824+  $ factory ->assertRanTimes (function  ($ process ) {
825+  return  str_contains ($ process ->command , 'printenv TEST_VAR OTHER_VAR ' );
826+  }, 2 );
827+  }
828+ 
798829 protected  function  ls ()
799830 {
800831 return  windows_os () ? 'dir '  : 'ls ' ;
0 commit comments