mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
tests: fixes failing test
This commit is contained in:
@ -1,18 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
function addName()
|
function addUser()
|
||||||
{
|
{
|
||||||
test()->user = 'nuno';
|
test()->user = 'nuno';
|
||||||
}
|
}
|
||||||
|
|
||||||
it('can set/get properties on $this', function () {
|
it('can set/get properties on $this', function () {
|
||||||
addName();
|
addUser();
|
||||||
assertEquals('nuno', $this->name);
|
assertEquals('nuno', $this->user);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('throws error if property do not exist', function () {
|
it('throws error if property do not exist', function () {
|
||||||
test()->user;
|
test()->user;
|
||||||
})->throws(\Whoops\Exception\ErrorException::class, 'Undefined property PHPUnit\Framework\TestCase::$name');
|
})->throws(\Whoops\Exception\ErrorException::class, 'Undefined property PHPUnit\Framework\TestCase::$user');
|
||||||
|
|
||||||
class User
|
class User
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user