X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fshell%2FCommandFactoryTest.php;h=b031431af75fb60501127751b85dc6cac1e5e1eb;hp=f90e8377ca240c58e4d519d436fbc62ca2e523b4;hb=63d96c15fde8d4d2842aa50c5ed2ce594aa0c674;hpb=28cb34cfae46c29033f10a3b192ec3e5bde3f6b7 diff --git a/tests/phpunit/includes/shell/CommandFactoryTest.php b/tests/phpunit/includes/shell/CommandFactoryTest.php index f90e8377ca..b031431af7 100644 --- a/tests/phpunit/includes/shell/CommandFactoryTest.php +++ b/tests/phpunit/includes/shell/CommandFactoryTest.php @@ -1,13 +1,18 @@ 40, ]; - $factory = new CommandFactory( $limits, $cgroup ); + $factory = new CommandFactory( $limits, $cgroup, false ); $factory->setLogger( $logger ); $factory->logStderr(); $command = $factory->create(); + $this->assertInstanceOf( Command::class, $command ); $wrapper = TestingAccessWrapper::newFromObject( $command ); $this->assertSame( $logger, $wrapper->logger ); @@ -32,4 +38,13 @@ class CommandFactoryTest extends PHPUnit_Framework_TestCase { $this->assertSame( $limits, $wrapper->limits ); $this->assertTrue( $wrapper->doLogStderr ); } + + /** + * @covers MediaWiki\Shell\CommandFactory::create + */ + public function testFirejailCreate() { + $factory = new CommandFactory( [], false, 'firejail' ); + $factory->setLogger( new NullLogger() ); + $this->assertInstanceOf( FirejailCommand::class, $factory->create() ); + } }