Duplicate attachments & external links during task duplication & importing
This commit is contained in:
@@ -498,6 +498,12 @@ 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);
|
||||
@@ -522,6 +528,12 @@ 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);
|
||||
@@ -572,6 +584,12 @@ 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);
|
||||
|
||||
@@ -435,7 +435,7 @@ class TaskFileModelTest extends Base
|
||||
$this->assertEquals(2, $fileModel->create(1, 'test', 'tmp/foo', 10));
|
||||
|
||||
$this->container['objectStorage']
|
||||
->expects($this->exactly(2))
|
||||
->expects($this->exactly(1))
|
||||
->method('remove')
|
||||
->with('tmp/foo');
|
||||
|
||||
|
||||
@@ -17,6 +17,17 @@ 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);
|
||||
|
||||
Reference in New Issue
Block a user