New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第4章 意図を語るテスト #6

Merged
merged 1 commit into from Jan 1, 2019

Conversation

1 participant
@tenkoma
Copy link
Owner

tenkoma commented Jan 1, 2019

No description provided.

$this->assertSame(10, $product->amount);
$product = $five->times(3);
$this->assertSame(15, $product->amount);
$this->assertTrue($five->times(2)->equals(new Dollar(10)));

This comment has been minimized.

@tenkoma

tenkoma Jan 1, 2019

Owner

assertSame() では、 new Dollar(10)$five->times(2) を比較すると、エラーになる(同じオブジェクトでないため)ので、equals() を明示的に使う。

@tenkoma tenkoma merged commit 5b07a6b into master Jan 1, 2019

1 check passed

ci/circleci: php_test Your tests passed on CircleCI!
Details

@tenkoma tenkoma deleted the chapter4 branch Jan 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment