Skip to content

Commit

Permalink
Improve FTP client unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
webeweb committed Dec 4, 2023
1 parent 2559151 commit c322e6c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/ftp/Client/FtpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,20 @@ public function testCdup(): void {

$obj = $this->client;

$this->assertSame($obj, $obj->chdir($this->remoteDir));
$this->assertSame($obj, $obj->cdup());
try {

$this->assertSame($obj, $obj->chdir($this->remoteDir));
$this->assertSame($obj, $obj->cdup());
} catch (Throwable $ex) {

$msg = implode("", [
$this->message,
"ftp_cdup failed",
]);

$this->assertInstanceOf(FtpException::class, $ex);
$this->assertEquals($msg, $ex->getMessage());
}

$obj->close();
}
Expand Down

0 comments on commit c322e6c

Please sign in to comment.