getMock('Mage\Config'); $config->expects($this->once()) ->method('getParameter') ->with($this->noColorParameter) ->will($this->returnValue(false)); $string = 'FooBar'; // Method need to be non static in the future $result = Colors::color($string, $config); $expected = "\033[0;32mFooBar\033[0m"; $this->assertSame($expected, $result); } /** * @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 = 'FooBar'; // Method need to be non static in the future $result = Colors::color($string, $config); $expected = 'FooBar'; $this->assertSame($expected, $result); } /** * @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 = 'FooBar'; // Method need to be non static in the future $result = Colors::color($string, $config); $this->assertSame($string, $result); } }