function it_save_and_index_updated_recipes(Storage $storage, SearchEngine $searchEngine) { $recipe = new Recipe(new Name("Screwdriver")); $recipe->publish(); $command = new EditCommand($recipe, new ChangeSet()); $searchEngine->indexRecipe(Argument::any())->shouldBeCalled(); $storage->save(Argument::type(Recipe::class))->shouldBeCalled(); $this->handle($command); }