File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,32 @@ protected function setUp()
3434 $ this ->workaroundMockeryIssue268 ();
3535 }
3636
37+ /**
38+ * Tests passing by reference as described in Mockery's manual with Mockery::on().
39+ *
40+ * @test
41+ * @link http://docs.mockery.io/en/latest/reference/pass_by_reference_behaviours.html
42+ */
43+ public function testMockeryPassByReference ()
44+ {
45+ PHPMockery::mock (__NAMESPACE__ , "exec " )->with (
46+ "command " ,
47+ \Mockery::on (function (&$ output ) {
48+ $ output = "output " ;
49+ return true ;
50+ }),
51+ \Mockery::on (function (&$ return_var ) {
52+ $ return_var = "return_var " ;
53+ return true ;
54+ })
55+ )->once ();
56+
57+ exec ("command " , $ output , $ return_var );
58+
59+ $ this ->assertEquals ("output " , $ output );
60+ $ this ->assertEquals ("return_var " , $ return_var );
61+ }
62+
3763 /**
3864 * Workaround for Mockery's issue 268.
3965 *
You can’t perform that action at this time.
0 commit comments