Merge pull request #162 from edpauto/phpunit-tests-completion

Fixes #159: PHPUnit tests tuning
This commit is contained in:
Kuba Turek 2015-01-29 22:10:39 +01:00
commit 7be2dd8589
5 changed files with 17 additions and 3 deletions

2
.gitignore vendored
View file

@ -1,5 +1,7 @@
vendor
mage.phar
bin
!bin/mage
# OS generated files # // GitHub Recommendation
######################

View file

@ -18,6 +18,9 @@
"Command\\": ".mage/commands"
}
},
"config": {
"bin-dir": "bin"
},
"bin": [
"bin/mage"
]

3
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "a19528b890d301384e45c1ed7d221e26",
"hash": "c66ae8cd7e44d614445b273f310d9c34",
"packages": [],
"packages-dev": [
{
@ -755,6 +755,7 @@
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.3"
},

View file

@ -5,8 +5,8 @@
backupGlobals="false"
verbose="true"
strict="true"
colors="false">
<testsuite name="small">
colors="true">
<testsuite name="unit-tests">
<directory suffix="Test.php">tests</directory>
</testsuite>

View file

@ -7,17 +7,21 @@ use PHPUnit_Framework_TestCase;
/**
* @group Mage_Console_Colors
* @coversDefaultClass Mage\Console\Colors
*/
class ColorsTest extends PHPUnit_Framework_TestCase
{
private $noColorParameter = "no-color";
/**
* @group 159
* @covers ::color
*/
public function testColor()
{
$config = $this->getMock('Mage\Config');
$config->expects($this->once())
->method('getParameter')
->with($this->noColorParameter)
->will($this->returnValue(false));
$string = '<green>FooBar</green>';
@ -31,12 +35,14 @@ class ColorsTest extends PHPUnit_Framework_TestCase
/**
* @group 159
* @covers ::color
*/
public function testColorNoColor()
{
$config = $this->getMock('Mage\Config');
$config->expects($this->once())
->method('getParameter')
->with($this->noColorParameter)
->will($this->returnValue(true));
$string = '<black>FooBar</black>';
@ -50,12 +56,14 @@ class ColorsTest extends PHPUnit_Framework_TestCase
/**
* @group 159
* @covers ::color
*/
public function testColorUnknownColorName()
{
$config = $this->getMock('Mage\Config');
$config->expects($this->once())
->method('getParameter')
->with($this->noColorParameter)
->will($this->returnValue(false));
$string = '<foo>FooBar</foo>';