diff --git a/tests/Feature/UserTest.php b/tests/Feature/UserTest.php new file mode 100644 index 0000000..b19fea9 --- /dev/null +++ b/tests/Feature/UserTest.php @@ -0,0 +1,32 @@ + new User(18, 'John'); + +test('class constructor') + ->expect($makeUser) + ->name->toBe('John') + ->age->toBe(18) + ->favorite_movies->toBeEmpty(); + +test('tellName') + ->expect($makeUser) + ->tellName()->toBeString()->toContain('John'); + +test('tellAge') + ->expect($makeUser) + ->tellAge()->toBeString()->toContain('18'); + +test('addFavoriteMovie') + ->expect($makeUser) + ->addFavoriteMovie('Avengers') + ->toBeTrue() + ->favorite_movies->toContain('Avengers')->toHaveLength(1); + +test('removeFavoriteMovie') + ->expect($makeUser) + ->addFavoriteMovie('Avengers')->toBeTrue() + ->addFavoriteMovie('Justice League')->toBeTrue() + ->removeFavoriteMovie('Avengers')->toBeTrue() + ->favorite_movies->not->toContain('Avengers')->toHaveLength(1); diff --git a/tests/ExampleTest.php b/tests/Unit/ExampleTest.php similarity index 100% rename from tests/ExampleTest.php rename to tests/Unit/ExampleTest.php