Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[9-8] InquiryCsvBuilderTestクラスのCSVのテストを実装
- Loading branch information
1 parent
7a0cf54
commit 29fb521
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
public function CSVが正しく作られること() | ||
{ | ||
$inquiry1 = new Inquiry(); | ||
$inquiry1->setId(1); | ||
$inquiry1->setName('テストあいうえお'); | ||
$inquiry1->setEmail('aiu@example.com'); | ||
$inquiry2 = new Inquiry(); | ||
$inquiry2->setId(2); | ||
$inquiry2->setName('テストかきく けこ'); | ||
$inquiry2->setEmail('keko@example.com'); | ||
$inquiryCollection = new ArrayCollection([$inquiry1, $inquiry2]); | ||
$this->inquiryRepository->expects($this->once()) | ||
->method('findAllByKeyword') | ||
->willReturn($inquiryCollection); | ||
|
||
$result = $this->SUT->build('テスト'); | ||
|
||
$expected = '1,テストあいうえお,aiu@example.com' . "\r\n" . | ||
'2,"テストかきく けこ",keko@example.com' . "\r\n"; | ||
|
||
$this->assertThat($result, $this->equalTo($expected)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters