* method to gather if this session is 'interactive' or 'non interactive'
parent
d1482bfa3c
commit
3f665e8bbb
|
@ -242,6 +242,28 @@ class SvnDriver extends VcsDriver implements VcsDriverInterface
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if composer was called with --no-interaction/-n
|
||||||
|
* and return the option string for the command.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @uses parent::$io
|
||||||
|
* @see IOInterface::isInteractive()
|
||||||
|
*/
|
||||||
|
public function getSvnInteractiveSetting()
|
||||||
|
{
|
||||||
|
static $option;
|
||||||
|
if ($option !== null) {
|
||||||
|
return $option;
|
||||||
|
}
|
||||||
|
if ($this->io->isInteractive() === false) {
|
||||||
|
$option = '--non-interactive ';
|
||||||
|
} else {
|
||||||
|
$option = '';
|
||||||
|
}
|
||||||
|
return $option;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -44,4 +44,10 @@ class SvnDriverTest extends \PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
$this->assertEquals($expect, $svn->getSvnCredentialString());
|
$this->assertEquals($expect, $svn->getSvnCredentialString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testInteractiveString()
|
||||||
|
{
|
||||||
|
$io = new \Composer\IO\NullIO; // non-interactive by design
|
||||||
|
$svn = new SvnDriver('http://svn.example.org', $io);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue