*/
public function iRun( $cmd )
{
+ if ( false !== strpos( $cmd, '<STDOUT>' ) ) {
+ if ( !isset( $this->result ) )
+ throw new \Exception( 'No previous command.' );
+
+ $cmd = str_replace( '<STDOUT>', trim( $this->result->STDOUT ), $cmd );
+ }
+
$cmd = ltrim( str_replace( 'wp', '', $cmd ) );
$this->result = $this->runner->run( $cmd );
Then the return code should be 0
And STDOUT should match '%d'
- When I run the previous command again
- Then the return code should be 1
+ When I run `wp user delete <STDOUT>`
+ Then the return code should be 0
+ And STDOUT should not be empty