Skip to content

Commit e657c3d

Browse files
committed
Add test for step loading
1 parent 62ce539 commit e657c3d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/tool_dataflows_sftp_test.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
use Symfony\Component\Yaml\Yaml;
2020
use tool_dataflows\local\step\connector_sftp;
21+
use tool_dataflows\local\step\connector_sftp_delete_file;
2122
use tool_dataflows\local\step\connector_sftp_directory_file_list;
23+
use tool_dataflows\local\step\connector_sftp_rename_file;
2224

2325
/**
2426
* Unit test for SFTP.
@@ -198,6 +200,32 @@ private function make_dataflow(string $target): dataflow {
198200
'target' => $target,
199201
]);
200202
$dataflow->add_step($step);
203+
// Step Rename file.
204+
$step = new step();
205+
$step->name = 'sftp_rename_file';
206+
$step->type = connector_sftp_rename_file::class;
207+
$step->config = Yaml::dump([
208+
'host' => 'host',
209+
'port' => 22,
210+
'username' => 'username',
211+
'password' => 'password',
212+
'source' => 'sftp://unusedsource.txt',
213+
'target' => 'sftp://otherfile.txt',
214+
]);
215+
$dataflow->add_step($step);
216+
217+
// Step Rename file.
218+
$step = new step();
219+
$step->name = 'sftp_delete_file';
220+
$step->type = connector_sftp_delete_file::class;
221+
$step->config = Yaml::dump([
222+
'host' => 'host',
223+
'port' => 22,
224+
'username' => 'username',
225+
'password' => 'password',
226+
'source' => 'sftp://unusedsource.txt',
227+
]);
228+
$dataflow->add_step($step);
201229

202230
return $dataflow;
203231
}

0 commit comments

Comments
 (0)