Skip to content

Commit

Permalink
refactor: Remove unused param from export CMDs
Browse files Browse the repository at this point in the history
  • Loading branch information
fibble committed Oct 3, 2024
1 parent 3ef329f commit 44c8c4c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,25 @@ protected function getCommandDTOs()
{
return [
DataDvaNiExport::create([
'reportName' => 'exampleReport',
'path' => '/path/to/save'
'reportName' => 'exampleReport'
]),
];
}

public function testExecuteSuccess()
{
$params = [
'reportName' => 'exampleReport',
'path' => '/path/to/save',
'reportName' => 'exampleReport'
];

$this->mockCommandHandlerManager->expects($this->once())
->method('handleCommand')
->with($this->callback(fn($command) => $command instanceof DataDvaNiExport
&& $command->getReportName() === $params['reportName']
&& $command->getPath() === $params['path']))
&& $command->getReportName() === $params['reportName']))
->willReturn(new Result());

$this->executeCommand([
'--report-name' => $params['reportName'],
'--path' => $params['path'],
'--report-name' => $params['reportName']
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class DataGovUkExportCommandTest extends AbstractBatchCommandCases
{
protected $additionalArguments = [
'--report-name' => 'govReport',
'--path' => '/gov/path/to/save',
];

protected function getCommandClass()
Expand All @@ -27,8 +26,7 @@ protected function getCommandDTOs()
{
return [
DataGovUkExport::create([
'reportName' => $this->additionalArguments['--report-name'],
'path' => $this->additionalArguments['--path']
'reportName' => $this->additionalArguments['--report-name']
])
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ public function test()
$sut = DataDvaNiExport::create($params);

static::assertEquals('unit_ReportName', $sut->getReportName());
static::assertEquals('unit_Path', $sut->getPath());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ public function test()
$sut = DataGovUkExport::create($params);

static::assertEquals('unit_ReportName', $sut->getReportName());
static::assertEquals('unit_Path', $sut->getPath());
}
}

0 comments on commit 44c8c4c

Please sign in to comment.