public function test_removing_recipe_from_storage() { $recipe = new Recipe(new Name("Screwdriver")); $this->storage->save($recipe); $this->storage->remove($recipe); $fileName = DIRECTORY_SEPARATOR . 'screwdriver'; $this->assertFileNotExists(MY_DRINKS_VAR_DIR . '/tmp/' . $fileName, $this->serializer->serialize($recipe)); }
/** * @param Recipe $recipe */ public function save(Recipe $recipe) { $fileName = $this->generateFileName($recipe->getName()); $this->filesystem->write($fileName, $this->serializer->serialize($recipe)); }