public function testアイテムにコメントを投稿できること() { $expected = 'test'; $dummyComment = new Comment(['body' => $expected]); $this->apiMock->shouldReceive('postItemsItemIdComments')->andReturn($dummyComment); $item = new Item(['id' => 'abcdefghijklmnopq123']); $comment = $item->postComment($expected); $actual = $comment->getBody(); $actual = rtrim($actual); $this->assertTrue($comment instanceof CommentInterface, 'Commentインターフェースを実装していること'); $this->assertEquals($expected, $actual, '設定したコメント文が正しく投稿できた'); }