mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
feat(expect): updates test suite to use expectation api
This commit is contained in:
@ -7,7 +7,7 @@ function addUser()
|
||||
|
||||
it('can set/get properties on $this', function () {
|
||||
addUser();
|
||||
assertEquals('nuno', $this->user);
|
||||
expect($this->user)->toBe('nuno');
|
||||
});
|
||||
|
||||
it('throws error if property do not exist', function () {
|
||||
@ -27,15 +27,14 @@ function mockUser()
|
||||
$mock = test()->createMock(User::class);
|
||||
|
||||
$mock->method('getName')
|
||||
->willReturn('maduro');
|
||||
->willReturn('maduro');
|
||||
|
||||
return $mock;
|
||||
}
|
||||
|
||||
it('allows to call underlying protected/private methods', function () {
|
||||
$user = mockUser();
|
||||
|
||||
assertEquals('maduro', $user->getName());
|
||||
expect($user->getName())->toBe('maduro');
|
||||
});
|
||||
|
||||
it('throws error if method do not exist', function () {
|
||||
|
||||
Reference in New Issue
Block a user