Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Add test for minimal install request
Browse files Browse the repository at this point in the history
  • Loading branch information
geerteltink committed Aug 29, 2016
1 parent 5dcaed0 commit 2b2b10d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ExpressiveInstaller/OptionalPackages.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public static function removeLineFromString($entry, $content)
*
* @return bool
*/
private static function requestMinimal(IOInterface $io)
public static function requestMinimal(IOInterface $io)
{
$query = [
sprintf(
Expand Down
34 changes: 34 additions & 0 deletions test/ExpressiveInstallerTest/RequestMinimalTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @see https://github.com/zendframework/zend-expressive-skeleton for the canonical source repository
* @copyright Copyright (c) 2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license https://github.com/zendframework/zend-expressive-skeleton/blob/master/LICENSE.md New BSD License
*/

namespace ExpressiveInstallerTest;

use ExpressiveInstaller\OptionalPackages;
use Prophecy\Argument;

class RequestMinimalTest extends InstallerTestCase
{
public function testRequestMinimalInstallIsTrue()
{
$io = $this->prophesize('Composer\IO\IOInterface');
$io->ask(Argument::any(), Argument::any())->willReturn('y');

$answer = OptionalPackages::requestMinimal($io->reveal());
$this->assertTrue($answer);
}

public function testRequestMinimalInstallIsFalse()
{
$io = $this->prophesize('Composer\IO\IOInterface');
$io->ask(Argument::any(), Argument::any())->willReturn('n');

$answer = OptionalPackages::requestMinimal($io->reveal());
$this->assertFalse($answer);
}
}

0 comments on commit 2b2b10d

Please sign in to comment.