mirror of
https://github.com/hauke68/Magallanes.git
synced 2025-09-16 13:50:17 +02:00
fix for Instantiator coverage instead of uses annotation
This commit is contained in:
parent
4c529e9e43
commit
35aa80a82f
@ -9,7 +9,6 @@ use PHPUnit_Framework_TestCase;
|
|||||||
* @group MageTest_Task
|
* @group MageTest_Task
|
||||||
* @group MageTest_Task_Factory
|
* @group MageTest_Task_Factory
|
||||||
* @uses Mage\Task\AbstractTask
|
* @uses Mage\Task\AbstractTask
|
||||||
* @uses Doctrine\Instantiator\Instantiator
|
|
||||||
* @covers Mage\Task\Factory
|
* @covers Mage\Task\Factory
|
||||||
*
|
*
|
||||||
* @group issue-176
|
* @group issue-176
|
||||||
@ -23,12 +22,18 @@ class FactoryTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->config = $this->getMock('Mage\\Config');
|
$this->config = $this->getMock('Mage\\Config');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers Mage\Task\Factory::get
|
||||||
|
*/
|
||||||
public function testGet()
|
public function testGet()
|
||||||
{
|
{
|
||||||
$task = Factory::get('composer/install', $this->config);
|
$task = Factory::get('composer/install', $this->config);
|
||||||
$this->assertInstanceOf('\\Mage\\Task\\BuiltIn\\Composer\\InstallTask', $task);
|
$this->assertInstanceOf('\\Mage\\Task\\BuiltIn\\Composer\\InstallTask', $task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers Mage\Task\Factory::get
|
||||||
|
*/
|
||||||
public function testGetTaskDataIsArray()
|
public function testGetTaskDataIsArray()
|
||||||
{
|
{
|
||||||
$taskData = array(
|
$taskData = array(
|
||||||
@ -40,10 +45,13 @@ class FactoryTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertInstanceOf('\\Mage\\Task\\BuiltIn\\Composer\\InstallTask', $task);
|
$this->assertInstanceOf('\\Mage\\Task\\BuiltIn\\Composer\\InstallTask', $task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers Mage\Task\Factory::get
|
||||||
|
*/
|
||||||
public function testGetCustomTask()
|
public function testGetCustomTask()
|
||||||
{
|
{
|
||||||
$this->getMockBuilder('Mage\\Task\\AbstractTask')
|
$this->getMockBuilder('Mage\\Task\\AbstractTask')
|
||||||
->disableOriginalConstructor()
|
->setConstructorArgs(array($this->config))
|
||||||
->setMockClassName('MyTask')
|
->setMockClassName('MyTask')
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
@ -57,6 +65,9 @@ class FactoryTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertInstanceOf('Task\\MyTask', $task);
|
$this->assertInstanceOf('Task\\MyTask', $task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers Mage\Task\Factory::get
|
||||||
|
*/
|
||||||
public function testGetWithOptionalParams()
|
public function testGetWithOptionalParams()
|
||||||
{
|
{
|
||||||
$task = Factory::get('composer/install', $this->config, true, 'production');
|
$task = Factory::get('composer/install', $this->config, true, 'production');
|
||||||
@ -66,6 +77,7 @@ class FactoryTest extends PHPUnit_Framework_TestCase
|
|||||||
/**
|
/**
|
||||||
* @expectedException \Exception
|
* @expectedException \Exception
|
||||||
* @expectedExceptionMessage The Task MyInconsistentTask must be an instance of Mage\Task\AbstractTask.
|
* @expectedExceptionMessage The Task MyInconsistentTask must be an instance of Mage\Task\AbstractTask.
|
||||||
|
* @covers Mage\Task\Factory::get
|
||||||
*/
|
*/
|
||||||
public function testGetInconsistentException()
|
public function testGetInconsistentException()
|
||||||
{
|
{
|
||||||
@ -76,6 +88,7 @@ class FactoryTest extends PHPUnit_Framework_TestCase
|
|||||||
/**
|
/**
|
||||||
* @expectedException \Exception
|
* @expectedException \Exception
|
||||||
* @expectedExceptionMessage Task "Unknowntask" not found.
|
* @expectedExceptionMessage Task "Unknowntask" not found.
|
||||||
|
* @covers Mage\Task\Factory::get
|
||||||
*/
|
*/
|
||||||
public function testGetClassDoesNotExist()
|
public function testGetClassDoesNotExist()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user