-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[9-4] MemberCollectionTestのテストケースの完成
- Loading branch information
1 parent
4256d6f
commit 5bffe27
Showing
2 changed files
with
43 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,25 @@ | ||
/** | ||
* @test | ||
*/ | ||
public function 指定した属性のメンバーが追加されていること() | ||
{ | ||
$memberCollection = new MemberCollection(); | ||
|
||
$this->assertThat($memberCollection->count(), $this->equalTo(0), | ||
'初期状態のコレクションの要素数が0'); | ||
|
||
$memberCollection->addMember('testname', 'testpart', '2015-01-15'); | ||
|
||
$this->assertThat($memberCollection->count(), $this->equalTo(1), | ||
'追加後のコレクションの要素数が1か'); | ||
|
||
$member = $memberCollection->last(); | ||
$this->assertThat($member, $this->isInstanceOf(Member::class), | ||
'コレクションに追加された要素がMemberか'); | ||
$this->assertThat($member->getName(), $this->equalTo('testname'), | ||
'nameプロパティが設定されているか'); | ||
$this->assertThat($member->getPart(), $this->equalTo('testpart'), | ||
'partプロパティが設定されているか'); | ||
$this->assertThat($member->getJoinedDate(), $this->equalTo('2015-01-15'), | ||
'joinedDateプロパティが設定されているか'); | ||
} |
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