From dae179acad7d6e3c535f8ea098f4ebc9f9f5e8d2 Mon Sep 17 00:00:00 2001 From: Kuba Turek Date: Tue, 2 Dec 2014 19:44:43 +0100 Subject: [PATCH 1/7] Add vendor's bins to bin directory --- .gitignore | 2 ++ composer.json | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 66f4d84..88c7e14 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ vendor mage.phar +bin +!bin/mage # OS generated files # // GitHub Recommendation ###################### diff --git a/composer.json b/composer.json index 2183c74..a3a6868 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,9 @@ "Command\\": ".mage/commands" } }, + "config": { + "bin-dir": "bin" + }, "bin": [ "bin/mage" ] From 86f25b2de63ea769659dce3ce7e598fa88e882d5 Mon Sep 17 00:00:00 2001 From: Kuba Turek Date: Tue, 2 Dec 2014 19:53:33 +0100 Subject: [PATCH 2/7] Add 'with' to config class method expectations --- tests/MageTest/Console/ColorsTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/MageTest/Console/ColorsTest.php b/tests/MageTest/Console/ColorsTest.php index 2655409..51cc5bc 100644 --- a/tests/MageTest/Console/ColorsTest.php +++ b/tests/MageTest/Console/ColorsTest.php @@ -18,6 +18,7 @@ class ColorsTest extends PHPUnit_Framework_TestCase $config = $this->getMock('Mage\Config'); $config->expects($this->once()) ->method('getParameter') + ->with('no-color') ->will($this->returnValue(false)); $string = 'FooBar'; @@ -37,6 +38,7 @@ class ColorsTest extends PHPUnit_Framework_TestCase $config = $this->getMock('Mage\Config'); $config->expects($this->once()) ->method('getParameter') + ->with('no-color') ->will($this->returnValue(true)); $string = 'FooBar'; @@ -56,6 +58,7 @@ class ColorsTest extends PHPUnit_Framework_TestCase $config = $this->getMock('Mage\Config'); $config->expects($this->once()) ->method('getParameter') + ->with('no-color') ->will($this->returnValue(false)); $string = 'FooBar'; From 93249ce5e58738aee43af5f578a19bfe95dc2c3b Mon Sep 17 00:00:00 2001 From: Kuba Turek Date: Tue, 2 Dec 2014 19:53:43 +0100 Subject: [PATCH 3/7] Add coverage annotations --- tests/MageTest/Console/ColorsTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/MageTest/Console/ColorsTest.php b/tests/MageTest/Console/ColorsTest.php index 51cc5bc..2aaf262 100644 --- a/tests/MageTest/Console/ColorsTest.php +++ b/tests/MageTest/Console/ColorsTest.php @@ -7,11 +7,13 @@ use PHPUnit_Framework_TestCase; /** * @group Mage_Console_Colors + * @coversDefaultClass Mage\Console\Colors */ class ColorsTest extends PHPUnit_Framework_TestCase { /** * @group 159 + * @covers ::color */ public function testColor() { @@ -32,6 +34,7 @@ class ColorsTest extends PHPUnit_Framework_TestCase /** * @group 159 + * @covers ::color */ public function testColorNoColor() { @@ -52,6 +55,7 @@ class ColorsTest extends PHPUnit_Framework_TestCase /** * @group 159 + * @covers ::color */ public function testColorUnknownColorName() { From 8694805eba3c7a13207f4603c33f201d9c013129 Mon Sep 17 00:00:00 2001 From: Kuba Turek Date: Tue, 2 Dec 2014 19:55:46 +0100 Subject: [PATCH 4/7] Move colour config parameter to class property --- tests/MageTest/Console/ColorsTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/MageTest/Console/ColorsTest.php b/tests/MageTest/Console/ColorsTest.php index 2aaf262..1830cc7 100644 --- a/tests/MageTest/Console/ColorsTest.php +++ b/tests/MageTest/Console/ColorsTest.php @@ -11,6 +11,7 @@ use PHPUnit_Framework_TestCase; */ class ColorsTest extends PHPUnit_Framework_TestCase { + protected $noColorParameter = "no-color"; /** * @group 159 * @covers ::color @@ -20,7 +21,7 @@ class ColorsTest extends PHPUnit_Framework_TestCase $config = $this->getMock('Mage\Config'); $config->expects($this->once()) ->method('getParameter') - ->with('no-color') + ->with($this->noColorParameter) ->will($this->returnValue(false)); $string = 'FooBar'; @@ -41,7 +42,7 @@ class ColorsTest extends PHPUnit_Framework_TestCase $config = $this->getMock('Mage\Config'); $config->expects($this->once()) ->method('getParameter') - ->with('no-color') + ->with($this->noColorParameter) ->will($this->returnValue(true)); $string = 'FooBar'; @@ -62,7 +63,7 @@ class ColorsTest extends PHPUnit_Framework_TestCase $config = $this->getMock('Mage\Config'); $config->expects($this->once()) ->method('getParameter') - ->with('no-color') + ->with($this->noColorParameter) ->will($this->returnValue(false)); $string = 'FooBar'; From b00509cf8e8a2bdaf93485746fa140cdb65bb95c Mon Sep 17 00:00:00 2001 From: Kuba Turek Date: Tue, 2 Dec 2014 19:56:58 +0100 Subject: [PATCH 5/7] Add some colors to phpunit output! :) --- phpunit.xml.dist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a5e1c3b..6fbbd61 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -5,8 +5,8 @@ backupGlobals="false" verbose="true" strict="true" - colors="false"> - + colors="true"> + tests From 9d9e5e2bea4cbae2667976b2d4c2a96b64e592ed Mon Sep 17 00:00:00 2001 From: Kuba Turek Date: Sat, 24 Jan 2015 21:50:31 +0100 Subject: [PATCH 6/7] Update composer.lock due to outer changes --- composer.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index bc2e079..e882f21 100644 --- a/composer.lock +++ b/composer.lock @@ -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" }, From 327625bad714fdc3e3b4a970f96ddff988297f29 Mon Sep 17 00:00:00 2001 From: Kuba Turek Date: Tue, 27 Jan 2015 19:47:08 +0100 Subject: [PATCH 7/7] [#183] Change test's description property visibility to private --- tests/MageTest/Console/ColorsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/MageTest/Console/ColorsTest.php b/tests/MageTest/Console/ColorsTest.php index 1830cc7..5038303 100644 --- a/tests/MageTest/Console/ColorsTest.php +++ b/tests/MageTest/Console/ColorsTest.php @@ -11,7 +11,7 @@ use PHPUnit_Framework_TestCase; */ class ColorsTest extends PHPUnit_Framework_TestCase { - protected $noColorParameter = "no-color"; + private $noColorParameter = "no-color"; /** * @group 159 * @covers ::color