Duplicate external links when duplicating tasks

Fixes #4748
This commit is contained in:
Frédéric Guillot
2023-04-06 20:04:15 -07:00
committed by Frédéric Guillot
parent 9c5f5a5854
commit 38e82fe5e5
6 changed files with 30 additions and 36 deletions

View File

@@ -13,12 +13,6 @@ class TaskDuplicateAnotherProjectTest extends Base
{
public function testSuccess()
{
$this->container['externalLinkManager'] = $this
->getMockBuilder('Kanboard\Core\ExternalLink\ExternalLinkManager')
->setConstructorArgs(array($this->container))
->setMethods(['push'])
->getMock();
$projectModel = new ProjectModel($this->container);
$taskCreationModel = new TaskCreationModel($this->container);
$taskFinderModel = new TaskFinderModel($this->container);

View File

@@ -87,6 +87,11 @@ abstract class Base extends PHPUnit\Framework\TestCase
$this->container['db']->getStatementHandler()->withLogging();
$this->container['cli'] = new \Symfony\Component\Console\Application('Kanboard', 'test');
$this->container['externalLinkManager'] = $this
->getMockBuilder('Kanboard\Core\ExternalLink\ExternalLinkManager')
->setConstructorArgs(array($this->container))
->getMock();
$this->container['httpClient'] = $this
->getMockBuilder('\Kanboard\Core\Http\Client')
->setConstructorArgs(array($this->container))

View File

@@ -498,12 +498,6 @@ class ProjectDuplicationModelTest extends Base
public function testCloneProjectWithTasks()
{
$this->container['externalLinkManager'] = $this
->getMockBuilder('Kanboard\Core\ExternalLink\ExternalLinkManager')
->setConstructorArgs(array($this->container))
->setMethods(['push'])
->getMock();
$projectModel = new ProjectModel($this->container);
$projectDuplicationModel = new ProjectDuplicationModel($this->container);
$taskCreationModel = new TaskCreationModel($this->container);
@@ -528,12 +522,6 @@ class ProjectDuplicationModelTest extends Base
public function testCloneProjectWithSwimlanesAndTasks()
{
$this->container['externalLinkManager'] = $this
->getMockBuilder('Kanboard\Core\ExternalLink\ExternalLinkManager')
->setConstructorArgs(array($this->container))
->setMethods(['push'])
->getMock();
$projectModel = new ProjectModel($this->container);
$projectDuplicationModel = new ProjectDuplicationModel($this->container);
$swimlaneModel = new SwimlaneModel($this->container);
@@ -584,12 +572,6 @@ class ProjectDuplicationModelTest extends Base
public function testCloneProjectWithTags()
{
$this->container['externalLinkManager'] = $this
->getMockBuilder('Kanboard\Core\ExternalLink\ExternalLinkManager')
->setConstructorArgs(array($this->container))
->setMethods(['push'])
->getMock();
$projectModel = new ProjectModel($this->container);
$projectDuplicationModel = new ProjectDuplicationModel($this->container);
$taskCreationModel = new TaskCreationModel($this->container);

View File

@@ -17,17 +17,6 @@ use Kanboard\Model\UserModel;
class TaskProjectDuplicationModelTest extends Base
{
protected function setUp(): void
{
parent::setUp();
$this->container['externalLinkManager'] = $this
->getMockBuilder('Kanboard\Core\ExternalLink\ExternalLinkManager')
->setConstructorArgs(array($this->container))
->setMethods(['push'])
->getMock();
}
public function testDuplicateAnotherProject()
{
$taskProjectDuplicationModel = new TaskProjectDuplicationModel($this->container);