use OC\IntegrityCheck\Checker;
use OC\IntegrityCheck\Helpers\FileAccessHelper;
use OCP\IURLGenerator;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
use Test\TestCase;
class SignAppTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->checker = $this->getMockBuilder('\OC\IntegrityCheck\Checker')
- ->disableOriginalConstructor()->getMock();
- $this->fileAccessHelper = $this->getMockBuilder('\OC\IntegrityCheck\Helpers\FileAccessHelper')
- ->disableOriginalConstructor()->getMock();
- $this->urlGenerator = $this->getMockBuilder('\OCP\IURLGenerator')
- ->disableOriginalConstructor()->getMock();
+ $this->checker = $this->createMock(Checker::class);
+ $this->fileAccessHelper = $this->createMock(FileAccessHelper::class);
+ $this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->signApp = new SignApp(
$this->checker,
$this->fileAccessHelper,
}
public function testExecuteWithMissingPath() {
- $inputInterface = $this->getMock('\Symfony\Component\Console\Input\InputInterface');
- $outputInterface = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
+ $inputInterface = $this->createMock(InputInterface::class);
+ $outputInterface = $this->createMock(OutputInterface::class);
$inputInterface
->expects($this->at(0))
}
public function testExecuteWithMissingPrivateKey() {
- $inputInterface = $this->getMock('\Symfony\Component\Console\Input\InputInterface');
- $outputInterface = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
+ $inputInterface = $this->createMock(InputInterface::class);
+ $outputInterface = $this->createMock(OutputInterface::class);
$inputInterface
->expects($this->at(0))
}
public function testExecuteWithMissingCertificate() {
- $inputInterface = $this->getMock('\Symfony\Component\Console\Input\InputInterface');
- $outputInterface = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
+ $inputInterface = $this->createMock(InputInterface::class);
+ $outputInterface = $this->createMock(OutputInterface::class);
$inputInterface
->expects($this->at(0))
}
public function testExecuteWithNotExistingPrivateKey() {
- $inputInterface = $this->getMock('\Symfony\Component\Console\Input\InputInterface');
- $outputInterface = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
+ $inputInterface = $this->createMock(InputInterface::class);
+ $outputInterface = $this->createMock(OutputInterface::class);
$inputInterface
->expects($this->at(0))
}
public function testExecuteWithNotExistingCertificate() {
- $inputInterface = $this->getMock('\Symfony\Component\Console\Input\InputInterface');
- $outputInterface = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
+ $inputInterface = $this->createMock(InputInterface::class);
+ $outputInterface = $this->createMock(OutputInterface::class);
$inputInterface
->expects($this->at(0))
}
public function testExecute() {
- $inputInterface = $this->getMock('\Symfony\Component\Console\Input\InputInterface');
- $outputInterface = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
+ $inputInterface = $this->createMock(InputInterface::class);
+ $outputInterface = $this->createMock(OutputInterface::class);
$inputInterface
->expects($this->at(0))
use OC\Core\Command\Integrity\SignCore;
use OC\IntegrityCheck\Checker;
use OC\IntegrityCheck\Helpers\FileAccessHelper;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
use Test\TestCase;
class SignCoreTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->checker = $this->getMockBuilder('\OC\IntegrityCheck\Checker')
- ->disableOriginalConstructor()->getMock();
- $this->fileAccessHelper = $this->getMockBuilder('\OC\IntegrityCheck\Helpers\FileAccessHelper')
- ->disableOriginalConstructor()->getMock();
+ $this->checker = $this->createMock(Checker::class);
+ $this->fileAccessHelper = $this->createMock(FileAccessHelper::class);
$this->signCore = new SignCore(
$this->checker,
$this->fileAccessHelper
}
public function testExecuteWithMissingPrivateKey() {
- $inputInterface = $this->getMock('\Symfony\Component\Console\Input\InputInterface');
- $outputInterface = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
+ $inputInterface = $this->createMock(InputInterface::class);
+ $outputInterface = $this->createMock(OutputInterface::class);
$inputInterface
->expects($this->at(0))
}
public function testExecuteWithMissingCertificate() {
- $inputInterface = $this->getMock('\Symfony\Component\Console\Input\InputInterface');
- $outputInterface = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
+ $inputInterface = $this->createMock(InputInterface::class);
+ $outputInterface = $this->createMock(OutputInterface::class);
$inputInterface
->expects($this->at(0))
}
public function testExecuteWithNotExistingPrivateKey() {
- $inputInterface = $this->getMock('\Symfony\Component\Console\Input\InputInterface');
- $outputInterface = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
+ $inputInterface = $this->createMock(InputInterface::class);
+ $outputInterface = $this->createMock(OutputInterface::class);
$inputInterface
->expects($this->at(0))
}
public function testExecuteWithNotExistingCertificate() {
- $inputInterface = $this->getMock('\Symfony\Component\Console\Input\InputInterface');
- $outputInterface = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
+ $inputInterface = $this->createMock(InputInterface::class);
+ $outputInterface = $this->createMock(OutputInterface::class);
$inputInterface
->expects($this->at(0))
}
public function testExecute() {
- $inputInterface = $this->getMock('\Symfony\Component\Console\Input\InputInterface');
- $outputInterface = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
+ $inputInterface = $this->createMock(InputInterface::class);
+ $outputInterface = $this->createMock(OutputInterface::class);
$inputInterface
->expects($this->at(0))