From f6c7185eb7408220433e5b02ce4ce8558dbba443 Mon Sep 17 00:00:00 2001 From: Michael Utz Date: Mon, 14 Nov 2022 22:24:22 +0300 Subject: [PATCH] Pest runs with dummy code --- phpunit.xml | 2 +- src/User.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/autoload.php | 3 +++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/User.php create mode 100644 src/autoload.php diff --git a/phpunit.xml b/phpunit.xml index 8f4b58c..39c5df8 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,7 +1,7 @@ diff --git a/src/User.php b/src/User.php new file mode 100644 index 0000000..854d30d --- /dev/null +++ b/src/User.php @@ -0,0 +1,48 @@ +age = $age; + $this->name = $name; + } + + public function tellName(): string + { + return "My name is " . $this->name . "."; + } + + public function tellAge(): string + { + return "I am " . $this->age . " years old."; + } + + public function addFavoriteMovie(string $movie): bool + { + $this->favorite_movies[] = $movie; + + return true; + } + + public function removeFavoriteMovie(string $movie): bool + { + if (!in_array($movie, $this->favorite_movies)) throw new InvalidArgumentException("Unknown movie: " . $movie); + + unset($this->favorite_movies[array_search($movie, $this->favorite_movies)]); + + return true; + } +} diff --git a/src/autoload.php b/src/autoload.php new file mode 100644 index 0000000..43e515f --- /dev/null +++ b/src/autoload.php @@ -0,0 +1,3 @@ +