@@ -101,52 +101,52 @@ public function testConfigUsernameUsed()
101
101
{
102
102
$ repository_connector = $ this ->_createRepositoryConnector ('user ' , '' );
103
103
104
- $ this ->_expectCommand ('svn --username user --version ' , 'OK ' );
104
+ $ this ->_expectCommand ('svn --non-interactive -- username user --version ' , 'OK ' );
105
105
$ this ->assertEquals ('OK ' , $ repository_connector ->getCommand ('--version ' )->run ());
106
106
}
107
107
108
108
public function testConfigPasswordUsed ()
109
109
{
110
110
$ repository_connector = $ this ->_createRepositoryConnector ('' , 'pass ' );
111
111
112
- $ this ->_expectCommand ('svn --password pass --version ' , 'OK ' );
112
+ $ this ->_expectCommand ('svn --non-interactive -- password pass --version ' , 'OK ' );
113
113
$ this ->assertEquals ('OK ' , $ repository_connector ->getCommand ('--version ' )->run ());
114
114
}
115
115
116
116
public function testSimpleCommand ()
117
117
{
118
- $ this ->_expectCommand ('svn --version ' , 'OK ' );
118
+ $ this ->_expectCommand ('svn --non-interactive -- version ' , 'OK ' );
119
119
$ this ->assertEquals ('OK ' , $ this ->_repositoryConnector ->getCommand ('--version ' )->run ());
120
120
}
121
121
122
122
public function testCommandWithParams ()
123
123
{
124
- $ this ->_expectCommand ('svn log -r 12 ' , 'OK ' );
124
+ $ this ->_expectCommand ('svn --non-interactive log -r 12 ' , 'OK ' );
125
125
$ this ->assertEquals ('OK ' , $ this ->_repositoryConnector ->getCommand ('log ' , '-r 12 ' )->run ());
126
126
}
127
127
128
128
public function testCommandWithPath ()
129
129
{
130
- $ this ->_expectCommand ("svn log 'path/to/folder' " , 'OK ' );
130
+ $ this ->_expectCommand ("svn --non-interactive log 'path/to/folder' " , 'OK ' );
131
131
$ this ->assertEquals ('OK ' , $ this ->_repositoryConnector ->getCommand ('log ' , '{path/to/folder} ' )->run ());
132
132
}
133
133
134
134
public function testCommandWithPathAndLeadingSlash ()
135
135
{
136
- $ this ->_expectCommand ("svn log '/path/to/folder' " , 'OK ' );
136
+ $ this ->_expectCommand ("svn --non-interactive log '/path/to/folder' " , 'OK ' );
137
137
$ this ->assertEquals ('OK ' , $ this ->_repositoryConnector ->getCommand ('log ' , '{/path/to/folder} ' )->run ());
138
138
}
139
139
140
140
public function testCommandWithPathAndParams ()
141
141
{
142
- $ this ->_expectCommand ("svn log -r 12 'path/to/folder' " , 'OK ' );
142
+ $ this ->_expectCommand ("svn --non-interactive log -r 12 'path/to/folder' " , 'OK ' );
143
143
$ this ->assertEquals ('OK ' , $ this ->_repositoryConnector ->getCommand ('log ' , '-r 12 {path/to/folder} ' )->run ());
144
144
}
145
145
146
146
public function testCommandThatFails ()
147
147
{
148
148
$ thrown_exception = null ;
149
- $ this ->_expectCommand ('svn any ' , '' , false );
149
+ $ this ->_expectCommand ('svn --non-interactive any ' , '' , false );
150
150
151
151
try {
152
152
$ this ->_repositoryConnector ->getCommand ('any ' )->run ();
@@ -173,7 +173,7 @@ public function testCommandThatFails()
173
173
174
174
public function testGetPropertyFound ()
175
175
{
176
- $ this ->_expectCommand ("svn propget test-p 'the/path' " , 'OK ' );
176
+ $ this ->_expectCommand ("svn --non-interactive propget test-p 'the/path' " , 'OK ' );
177
177
178
178
$ this ->assertEquals (
179
179
'OK ' ,
@@ -196,32 +196,23 @@ public function testGetPropertyNotFound()
196
196
0
197
197
);
198
198
199
- $ this ->_expectCommand ("svn propget test-p 'the/path' " , '' , false );
199
+ $ this ->_expectCommand ("svn --non-interactive propget test-p 'the/path' " , '' , false );
200
200
201
201
$ this ->_repositoryConnector ->getProperty ('test-p ' , 'the/path ' );
202
202
}
203
203
204
204
/**
205
205
* Sets expectation for specific command.
206
206
*
207
- * @param string $command Command.
208
- * @param string $output Output.
209
- * @param boolean $is_successful Should command be successful.
210
- * @param boolean $is_interactive Is interactive.
207
+ * @param string $command Command.
208
+ * @param string $output Output.
209
+ * @param boolean $is_successful Should command be successful.
211
210
*
212
211
* @return void
213
212
*/
214
- private function _expectCommand ($ command , $ output , $ is_successful = true , $ is_interactive = false )
213
+ private function _expectCommand ($ command , $ output , $ is_successful = true )
215
214
{
216
- if ( !$ is_interactive ) {
217
- $ this ->_process ->setInput ('' )->shouldBeCalled ();
218
- }
219
-
220
- $ patched_command = preg_replace ('/^svn / ' , 'svn --non-interactive ' , $ command );
221
215
$ this ->_process ->getCommandLine ()->willReturn ($ command )->shouldBeCalled ();
222
- $ this ->_process ->setCommandLine ($ patched_command )->will (function ($ args , $ process ) {
223
- $ process ->getCommandLine ()->willReturn ($ args [0 ]);
224
- })->shouldBeCalled ();
225
216
226
217
$ expectation = $ this ->_process ->mustRun (null )->shouldBeCalled ();
227
218
0 commit comments