From 35aa80a82fcb752d3f39b8d03fc2294439054ce0 Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Mon, 16 Mar 2015 00:22:07 +0100 Subject: [PATCH] fix for Instantiator coverage instead of uses annotation --- tests/MageTest/Task/FactoryTest.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/MageTest/Task/FactoryTest.php b/tests/MageTest/Task/FactoryTest.php index 8f7e005..500ae21 100644 --- a/tests/MageTest/Task/FactoryTest.php +++ b/tests/MageTest/Task/FactoryTest.php @@ -9,7 +9,6 @@ use PHPUnit_Framework_TestCase; * @group MageTest_Task * @group MageTest_Task_Factory * @uses Mage\Task\AbstractTask - * @uses Doctrine\Instantiator\Instantiator * @covers Mage\Task\Factory * * @group issue-176 @@ -23,12 +22,18 @@ class FactoryTest extends PHPUnit_Framework_TestCase $this->config = $this->getMock('Mage\\Config'); } + /** + * @covers Mage\Task\Factory::get + */ public function testGet() { $task = Factory::get('composer/install', $this->config); $this->assertInstanceOf('\\Mage\\Task\\BuiltIn\\Composer\\InstallTask', $task); } + /** + * @covers Mage\Task\Factory::get + */ public function testGetTaskDataIsArray() { $taskData = array( @@ -40,10 +45,13 @@ class FactoryTest extends PHPUnit_Framework_TestCase $this->assertInstanceOf('\\Mage\\Task\\BuiltIn\\Composer\\InstallTask', $task); } + /** + * @covers Mage\Task\Factory::get + */ public function testGetCustomTask() { $this->getMockBuilder('Mage\\Task\\AbstractTask') - ->disableOriginalConstructor() + ->setConstructorArgs(array($this->config)) ->setMockClassName('MyTask') ->getMock(); @@ -57,6 +65,9 @@ class FactoryTest extends PHPUnit_Framework_TestCase $this->assertInstanceOf('Task\\MyTask', $task); } + /** + * @covers Mage\Task\Factory::get + */ public function testGetWithOptionalParams() { $task = Factory::get('composer/install', $this->config, true, 'production'); @@ -66,6 +77,7 @@ class FactoryTest extends PHPUnit_Framework_TestCase /** * @expectedException \Exception * @expectedExceptionMessage The Task MyInconsistentTask must be an instance of Mage\Task\AbstractTask. + * @covers Mage\Task\Factory::get */ public function testGetInconsistentException() { @@ -76,6 +88,7 @@ class FactoryTest extends PHPUnit_Framework_TestCase /** * @expectedException \Exception * @expectedExceptionMessage Task "Unknowntask" not found. + * @covers Mage\Task\Factory::get */ public function testGetClassDoesNotExist() {