mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-09 17:22:18 +02:00
Merge pull request #162 from edpauto/phpunit-tests-completion
Fixes #159: PHPUnit tests tuning
This commit is contained in:
commit
7be2dd8589
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,5 +1,7 @@
|
||||||
vendor
|
vendor
|
||||||
mage.phar
|
mage.phar
|
||||||
|
bin
|
||||||
|
!bin/mage
|
||||||
|
|
||||||
# OS generated files # // GitHub Recommendation
|
# OS generated files # // GitHub Recommendation
|
||||||
######################
|
######################
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
"Command\\": ".mage/commands"
|
"Command\\": ".mage/commands"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"config": {
|
||||||
|
"bin-dir": "bin"
|
||||||
|
},
|
||||||
"bin": [
|
"bin": [
|
||||||
"bin/mage"
|
"bin/mage"
|
||||||
]
|
]
|
||||||
|
|
3
composer.lock
generated
3
composer.lock
generated
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"hash": "a19528b890d301384e45c1ed7d221e26",
|
"hash": "c66ae8cd7e44d614445b273f310d9c34",
|
||||||
"packages": [],
|
"packages": [],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
{
|
{
|
||||||
|
@ -755,6 +755,7 @@
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": [],
|
"stability-flags": [],
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": ">=5.3"
|
"php": ">=5.3"
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
verbose="true"
|
verbose="true"
|
||||||
strict="true"
|
strict="true"
|
||||||
colors="false">
|
colors="true">
|
||||||
<testsuite name="small">
|
<testsuite name="unit-tests">
|
||||||
<directory suffix="Test.php">tests</directory>
|
<directory suffix="Test.php">tests</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
|
||||||
|
|
|
@ -7,17 +7,21 @@ use PHPUnit_Framework_TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group Mage_Console_Colors
|
* @group Mage_Console_Colors
|
||||||
|
* @coversDefaultClass Mage\Console\Colors
|
||||||
*/
|
*/
|
||||||
class ColorsTest extends PHPUnit_Framework_TestCase
|
class ColorsTest extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
private $noColorParameter = "no-color";
|
||||||
/**
|
/**
|
||||||
* @group 159
|
* @group 159
|
||||||
|
* @covers ::color
|
||||||
*/
|
*/
|
||||||
public function testColor()
|
public function testColor()
|
||||||
{
|
{
|
||||||
$config = $this->getMock('Mage\Config');
|
$config = $this->getMock('Mage\Config');
|
||||||
$config->expects($this->once())
|
$config->expects($this->once())
|
||||||
->method('getParameter')
|
->method('getParameter')
|
||||||
|
->with($this->noColorParameter)
|
||||||
->will($this->returnValue(false));
|
->will($this->returnValue(false));
|
||||||
|
|
||||||
$string = '<green>FooBar</green>';
|
$string = '<green>FooBar</green>';
|
||||||
|
@ -31,12 +35,14 @@ class ColorsTest extends PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group 159
|
* @group 159
|
||||||
|
* @covers ::color
|
||||||
*/
|
*/
|
||||||
public function testColorNoColor()
|
public function testColorNoColor()
|
||||||
{
|
{
|
||||||
$config = $this->getMock('Mage\Config');
|
$config = $this->getMock('Mage\Config');
|
||||||
$config->expects($this->once())
|
$config->expects($this->once())
|
||||||
->method('getParameter')
|
->method('getParameter')
|
||||||
|
->with($this->noColorParameter)
|
||||||
->will($this->returnValue(true));
|
->will($this->returnValue(true));
|
||||||
|
|
||||||
$string = '<black>FooBar</black>';
|
$string = '<black>FooBar</black>';
|
||||||
|
@ -50,12 +56,14 @@ class ColorsTest extends PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group 159
|
* @group 159
|
||||||
|
* @covers ::color
|
||||||
*/
|
*/
|
||||||
public function testColorUnknownColorName()
|
public function testColorUnknownColorName()
|
||||||
{
|
{
|
||||||
$config = $this->getMock('Mage\Config');
|
$config = $this->getMock('Mage\Config');
|
||||||
$config->expects($this->once())
|
$config->expects($this->once())
|
||||||
->method('getParameter')
|
->method('getParameter')
|
||||||
|
->with($this->noColorParameter)
|
||||||
->will($this->returnValue(false));
|
->will($this->returnValue(false));
|
||||||
|
|
||||||
$string = '<foo>FooBar</foo>';
|
$string = '<foo>FooBar</foo>';
|
||||||
|
|
Loading…
Reference in a new issue