mirror of
https://github.com/pestphp/pest.git
synced 2026-07-24 18:40:03 +02:00
fix: package lock fingerprint
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
<?php
|
||||
|
||||
function addUser()
|
||||
function addUser(): void
|
||||
{
|
||||
test()->user = 'nuno';
|
||||
}
|
||||
|
||||
it('can set/get properties on $this', function () {
|
||||
it('can set/get properties on $this', function (): void {
|
||||
addUser();
|
||||
expect($this->user)->toBe('nuno');
|
||||
});
|
||||
|
||||
it('gets null if property do not exist', function () {
|
||||
expect(test()->wqdwqdqw)->toBe(null);
|
||||
it('gets null if property do not exist', function (): void {
|
||||
expect(test()->wqdwqdqw)->toBeNull();
|
||||
});
|
||||
|
||||
class User
|
||||
{
|
||||
public function getName()
|
||||
public function getName(): string
|
||||
{
|
||||
return 'nuno';
|
||||
}
|
||||
@@ -32,12 +32,12 @@ function mockUser()
|
||||
return $mock;
|
||||
}
|
||||
|
||||
it('allows to call underlying protected/private methods', function () {
|
||||
it('allows to call underlying protected/private methods', function (): void {
|
||||
$user = mockUser();
|
||||
expect($user->getName())->toBe('maduro');
|
||||
});
|
||||
|
||||
it('throws error if method do not exist', function () {
|
||||
it('throws error if method do not exist', function (): void {
|
||||
test()->foo();
|
||||
})->throws(ReflectionException::class, 'Call to undefined method PHPUnit\Framework\TestCase::foo()');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user