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

Commit

Permalink
Merge branch 'hotfix/7476'
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed May 4, 2015
2 parents 7ec5645 + cff1d32 commit 48efbd9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions test/ConsoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testCanTestIsConsole()
$this->assertTrue(Console::isConsole());
$className = Console::detectBestAdapter();
$adpater = new $className;
$this->assertTrue($adpater instanceof Adapter\AdapterInterface);
$this->assertInstanceOf('Zend\Console\Adapter\AdapterInterface', $adpater);

Console::overrideIsConsole(false);

Expand Down Expand Up @@ -56,7 +56,7 @@ public function testCanOverrideIsConsole()
public function testCanGetInstance()
{
$console = Console::getInstance();
$this->assertTrue($console instanceof Adapter\AdapterInterface);
$this->assertInstanceOf('Zend\Console\Adapter\AdapterInterface', $console);
}

public function testCanNotGetInstanceInNoConsoleMode()
Expand All @@ -69,14 +69,14 @@ public function testCanNotGetInstanceInNoConsoleMode()
public function testCanForceInstance()
{
$console = Console::getInstance('Posix');
$this->assertTrue($console instanceof Adapter\AdapterInterface);
$this->assertTrue($console instanceof Adapter\Posix);
$this->assertInstanceOf('Zend\Console\Adapter\AdapterInterface', $console);
$this->assertInstanceOf('Zend\Console\Adapter\Posix', $console);

Console::overrideIsConsole(null);
Console::resetInstance();

$console = Console::getInstance('Windows');
$this->assertTrue($console instanceof Adapter\AdapterInterface);
$this->assertTrue($console instanceof Adapter\Windows);
$this->assertInstanceOf('Zend\Console\Adapter\AdapterInterface', $console);
$this->assertInstanceOf('Zend\Console\Adapter\Windows', $console);
}
}
8 changes: 4 additions & 4 deletions test/Prompt/NumberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testCanReadNumberOnMultilign()
ob_start();
$response = $number->show();
$text = ob_get_clean();
$this->assertTrue((bool) preg_match('#a is not a number#', $text));
$this->assertContains('a is not a number', $text);
$this->assertEquals('123', $response);
}

Expand All @@ -74,7 +74,7 @@ public function testCanNotReadFloatByDefault()
ob_start();
$response = $number->show();
$text = ob_get_clean();
$this->assertTrue((bool) preg_match('#Please enter a non-floating number#', $text));
$this->assertContains('Please enter a non-floating number', $text);
$this->assertEquals('123', $response);
}

Expand Down Expand Up @@ -108,8 +108,8 @@ public function testCanDefineAMax()
$response = $number->show();
$text = ob_get_clean();

$this->assertTrue((bool) preg_match('#Please enter a number not smaller than 5#', $text));
$this->assertTrue((bool) preg_match('#Please enter a number not greater than 10#', $text));
$this->assertContains('Please enter a number not smaller than 5', $text);
$this->assertContains('Please enter a number not greater than 10', $text);
$this->assertEquals('6', $response);
}
}
8 changes: 4 additions & 4 deletions test/Prompt/SelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public function testCanSelectOption()
ob_start();
$response = $select->show();
$text = ob_get_clean();
$this->assertTrue((bool) preg_match('#0\) foo#', $text));
$this->assertTrue((bool) preg_match('#1\) bar#', $text));
$this->assertContains('0) foo', $text);
$this->assertContains('1) bar', $text);
$this->assertEquals('0', $response);
}

Expand All @@ -56,8 +56,8 @@ public function testCanSelectOptionWithCustomIndex()
ob_start();
$response = $select->show();
$text = ob_get_clean();
$this->assertTrue((bool) preg_match('#2\) foo#', $text));
$this->assertTrue((bool) preg_match('#6\) bar#', $text));
$this->assertContains('2) foo', $text);
$this->assertContains('6) bar', $text);
$this->assertEquals('2', $response);
}
}

0 comments on commit 48efbd9

Please sign in to comment.