Skip to content

Commit 8967d17

Browse files
authored
Merge pull request #5 from PhantPHP/Add-get-path
Get path
2 parents 7467fef + 5e0c5d7 commit 8967d17

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

component/File.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ public function __construct(
1111
) {
1212
}
1313

14+
public function getPath(): string
15+
{
16+
return $this->path;
17+
}
18+
1419
public function exist(): bool
1520
{
1621
return file_exists($this->path);

test/FileTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ public function tearDown(): void
3333
unlink($this->filePath);
3434
}
3535

36+
public function testGetPath(): void
37+
{
38+
$result = $this->fixture->getPath();
39+
40+
$this->assertIsString($result);
41+
}
42+
3643
public function testGet(): void
3744
{
3845
$result = $this->fixture->exist();

0 commit comments

Comments
 (0)