Skip to content

Commit 66b5d38

Browse files
authored
Merge pull request #7 from hutushen222/hotfix/file-path-candidates-toarray
Fix FilePathCandidates::toArray()
2 parents 246440d + 37a38e4 commit 66b5d38

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/Domain/FilePathCandidates.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static function fromFilePaths(array $filePaths)
2525

2626
public function toArray(): array
2727
{
28-
return $this->filePath;
28+
return $this->filePaths;
2929
}
3030

3131
public function add(FilePath $filePath)

tests/Unit/FilePathCandidatesTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,17 @@ public function testEmpty()
5050
$candidates = FilePathCandidates::fromFilePaths([]);
5151
$this->assertTrue($candidates->noneFound());
5252
}
53+
54+
/**
55+
* @testdocs It can to array.
56+
*/
57+
public function testToArray()
58+
{
59+
$filePaths = [
60+
FilePath::fromString('Foobar'),
61+
];
62+
63+
$candidates = FilePathCandidates::fromFilePaths($filePaths);
64+
$this->assertEquals($candidates->toArray(), $filePaths);
65+
}
5366
}

0 commit comments

Comments
 (0)