From 6eb80e2d9074c579e13bd0601f7b0a357b5a876a Mon Sep 17 00:00:00 2001 From: David Carr Date: Wed, 27 Jul 2022 23:06:07 +0100 Subject: [PATCH] added snapshots --- ...tes_valid_json_file_after_disabling__1.txt | 3 + ...tes_valid_json_file_after_disabling__2.txt | 3 + ...ates_valid_json_file_after_enabling__1.txt | 3 + ...ates_valid_json_file_after_enabling__2.txt | 3 + ...it_can_change_the_default_namespace__1.txt | 68 +++++++++++ ...ange_the_default_namespace_specific__1.txt | 68 +++++++++++ ...generated_correct_file_with_content__1.txt | 68 +++++++++++ ...__it_uses_set_command_name_in_class__1.txt | 68 +++++++++++ ...it_can_change_the_default_namespace__1.txt | 28 +++++ ...generated_correct_file_with_content__1.txt | 28 +++++ ...roller_to_class_name_if_not_present__1.txt | 79 ++++++++++++ ...it_can_change_the_default_namespace__1.txt | 79 ++++++++++++ ...ange_the_default_namespace_specific__1.txt | 79 ++++++++++++ ...mespace_with_correct_generated_file__1.txt | 79 ++++++++++++ ...generated_correct_file_with_content__1.txt | 79 ++++++++++++ ...st__it_generates_a_plain_controller__1.txt | 9 ++ ...est__it_generates_an_api_controller__1.txt | 60 +++++++++ ...it_can_change_the_default_namespace__1.txt | 30 +++++ ...ange_the_default_namespace_specific__1.txt | 30 +++++ ...generated_correct_file_with_content__1.txt | 30 +++++ ...ryMakeCommandTest__it_makes_factory__1.txt | 28 +++++ ...it_can_change_the_default_namespace__1.txt | 34 ++++++ ...ange_the_default_namespace_specific__1.txt | 34 ++++++ ...generated_correct_file_with_content__1.txt | 34 ++++++ ..._correct_sync_job_file_with_content__1.txt | 31 +++++ ...it_can_change_the_default_namespace__1.txt | 30 +++++ ...ange_the_default_namespace_specific__1.txt | 30 +++++ ...rect_queued_duck_event_with_content__1.txt | 32 +++++ ...vent_in_a_subdirectory_with_content__1.txt | 33 +++++ ...d_correct_queued_event_with_content__1.txt | 33 +++++ ...orrect_sync_duck_event_with_content__1.txt | 30 +++++ ...vent_in_a_subdirectory_with_content__1.txt | 31 +++++ ...ted_correct_sync_event_with_content__1.txt | 31 +++++ ...it_can_change_the_default_namespace__1.txt | 33 +++++ ...ange_the_default_namespace_specific__1.txt | 33 +++++ ...generated_correct_file_with_content__1.txt | 33 +++++ ...it_can_change_the_default_namespace__1.txt | 21 ++++ ...ange_the_default_namespace_specific__1.txt | 21 ++++ ...generated_correct_file_with_content__1.txt | 21 ++++ ..._correct_add_migration_file_content__1.txt | 32 +++++ ...rrect_create_migration_file_content__1.txt | 32 +++++ ...rect_default_migration_file_content__1.txt | 28 +++++ ...rrect_delete_migration_file_content__1.txt | 32 +++++ ...correct_drop_migration_file_content__1.txt | 32 +++++ ...t_generates_foreign_key_constraints__1.txt | 34 ++++++ ...it_can_change_the_default_namespace__1.txt | 18 +++ ...ange_the_default_namespace_specific__1.txt | 18 +++ ...generated_correct_file_with_content__1.txt | 18 +++ ...gration_when_both_flags_are_present__1.txt | 79 ++++++++++++ ...gration_when_both_flags_are_present__2.txt | 32 +++++ ...enerates_controller_file_with_model__1.txt | 79 ++++++++++++ ...le_with_model_using_shortcut_option__1.txt | 79 ++++++++++++ ...t_generates_correct_fillable_fields__1.txt | 18 +++ ...file_name_with_multiple_words_model__1.txt | 32 +++++ ...generates_migration_file_with_model__1.txt | 32 +++++ ...le_with_model_using_shortcut_option__1.txt | 32 +++++ ...it_deletes_modules_from_status_file__1.txt | 3 + ...it_deletes_modules_from_status_file__2.txt | 1 + ...generates_api_module_with_resources__1.txt | 114 ++++++++++++++++++ ...generates_api_module_with_resources__2.txt | 60 +++++++++ ...generates_api_module_with_resources__3.txt | 21 ++++ ...generates_api_module_with_resources__4.txt | 69 +++++++++++ ...ndTest__it_generates_api_route_file__1.txt | 18 +++ ...generates_correct_composerjson_file__1.txt | 23 ++++ ...mandTest__it_generates_module_files__1.txt | 13 ++ ..._module_namespace_using_studly_case__1.txt | 114 ++++++++++++++++++ ...Test__it_generates_module_resources__1.txt | 114 ++++++++++++++++++ ...Test__it_generates_module_resources__2.txt | 79 ++++++++++++ ...Test__it_generates_module_resources__3.txt | 21 ++++ ...Test__it_generates_module_resources__4.txt | 69 +++++++++++ ...generates_web_module_with_resources__1.txt | 114 ++++++++++++++++++ ...generates_web_module_with_resources__2.txt | 79 ++++++++++++ ...generates_web_module_with_resources__3.txt | 21 ++++ ...generates_web_module_with_resources__4.txt | 69 +++++++++++ ...es_when_adding_more_than_one_option__1.txt | 114 ++++++++++++++++++ ...es_when_adding_more_than_one_option__2.txt | 79 ++++++++++++ ...es_when_adding_more_than_one_option__3.txt | 21 ++++ ...es_when_adding_more_than_one_option__4.txt | 69 +++++++++++ ...ndTest__it_generates_web_route_file__1.txt | 16 +++ ...mandTest__it_generates_webpack_file__1.txt | 14 +++ ...s_module_with_new_provider_location__1.txt | 13 ++ ...s_module_with_new_provider_location__2.txt | 23 ++++ ...it_can_change_the_default_namespace__1.txt | 61 ++++++++++ ...ange_the_default_namespace_specific__1.txt | 61 ++++++++++ ...generated_correct_file_with_content__1.txt | 61 ++++++++++ ...it_can_change_the_default_namespace__1.txt | 20 +++ ...ange_the_default_namespace_specific__1.txt | 20 +++ ...icyMakeCommandTest__it_makes_policy__1.txt | 20 +++ ...it_can_change_the_default_namespace__1.txt | 114 ++++++++++++++++++ ...ange_the_default_namespace_specific__1.txt | 114 ++++++++++++++++++ ..._migration_resources_location_paths__1.txt | 114 ++++++++++++++++++ ...generated_correct_file_with_content__1.txt | 28 +++++ ...vice_provider_with_resource_loading__1.txt | 114 ++++++++++++++++++ ...it_can_change_the_default_namespace__1.txt | 30 +++++ ...ange_the_default_namespace_specific__1.txt | 30 +++++ ...generated_correct_file_with_content__1.txt | 30 +++++ ...it_can_change_the_default_namespace__1.txt | 19 +++ ...ange_the_default_namespace_specific__1.txt | 19 +++ ...enerate_a_collection_resource_class__1.txt | 19 +++ ...generated_correct_file_with_content__1.txt | 19 +++ ...nge_the_custom_controller_namespace__1.txt | 69 +++++++++++ ...it_can_change_the_default_namespace__1.txt | 69 +++++++++++ ...ange_the_default_namespace_specific__1.txt | 69 +++++++++++ ...eCommandTest__it_can_overwrite_file__1.txt | 69 +++++++++++ ...__it_can_overwrite_route_file_names__1.txt | 69 +++++++++++ ...generated_correct_file_with_content__1.txt | 69 +++++++++++ ...it_can_change_the_default_namespace__1.txt | 40 ++++++ ...ange_the_default_namespace_specific__1.txt | 40 ++++++ .../RuleMakeCommandTest__it_makes_rule__1.txt | 40 ++++++ ...hange_the_default_feature_namespace__1.txt | 22 ++++ ..._default_feature_namespace_specific__1.txt | 22 ++++ ...n_change_the_default_unit_namespace__1.txt | 20 +++ ...the_default_unit_namespace_specific__1.txt | 20 +++ ...d_correct_feature_file_with_content__1.txt | 22 ++++ ...ated_correct_unit_file_with_content__1.txt | 20 +++ 115 files changed, 4998 insertions(+) create mode 100644 tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_disabling__1.txt create mode 100644 tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_disabling__2.txt create mode 100644 tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_enabling__1.txt create mode 100644 tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_enabling__2.txt create mode 100644 tests/Commands/__snapshots__/CommandMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/CommandMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/CommandMakeCommandTest__it_generated_correct_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/CommandMakeCommandTest__it_uses_set_command_name_in_class__1.txt create mode 100644 tests/Commands/__snapshots__/ComponentClassCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/ComponentClassCommandTest__it_generated_correct_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/ControllerMakeCommandTest__it_appends_controller_to_class_name_if_not_present__1.txt create mode 100644 tests/Commands/__snapshots__/ControllerMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/ControllerMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/ControllerMakeCommandTest__it_can_generate_a_controller_in_sub_namespace_with_correct_generated_file__1.txt create mode 100644 tests/Commands/__snapshots__/ControllerMakeCommandTest__it_generated_correct_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/ControllerMakeCommandTest__it_generates_a_plain_controller__1.txt create mode 100644 tests/Commands/__snapshots__/ControllerMakeCommandTest__it_generates_an_api_controller__1.txt create mode 100644 tests/Commands/__snapshots__/EventMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/EventMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/EventMakeCommandTest__it_generated_correct_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/FactoryMakeCommandTest__it_makes_factory__1.txt create mode 100644 tests/Commands/__snapshots__/JobMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/JobMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/JobMakeCommandTest__it_generated_correct_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/JobMakeCommandTest__it_generated_correct_sync_job_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/ListenerMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/ListenerMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/ListenerMakeCommandTest__it_generated_correct_queued_duck_event_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/ListenerMakeCommandTest__it_generated_correct_queued_event_in_a_subdirectory_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/ListenerMakeCommandTest__it_generated_correct_queued_event_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/ListenerMakeCommandTest__it_generated_correct_sync_duck_event_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/ListenerMakeCommandTest__it_generated_correct_sync_event_in_a_subdirectory_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/ListenerMakeCommandTest__it_generated_correct_sync_event_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/MailMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/MailMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/MailMakeCommandTest__it_generated_correct_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/MiddlewareMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/MiddlewareMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/MiddlewareMakeCommandTest__it_generated_correct_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/MigrationMakeCommandTest__it_generates_correct_add_migration_file_content__1.txt create mode 100644 tests/Commands/__snapshots__/MigrationMakeCommandTest__it_generates_correct_create_migration_file_content__1.txt create mode 100644 tests/Commands/__snapshots__/MigrationMakeCommandTest__it_generates_correct_default_migration_file_content__1.txt create mode 100644 tests/Commands/__snapshots__/MigrationMakeCommandTest__it_generates_correct_delete_migration_file_content__1.txt create mode 100644 tests/Commands/__snapshots__/MigrationMakeCommandTest__it_generates_correct_drop_migration_file_content__1.txt create mode 100644 tests/Commands/__snapshots__/MigrationMakeCommandTest__it_generates_foreign_key_constraints__1.txt create mode 100644 tests/Commands/__snapshots__/ModelMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/ModelMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/ModelMakeCommandTest__it_generated_correct_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_controller_and_migration_when_both_flags_are_present__1.txt create mode 100644 tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_controller_and_migration_when_both_flags_are_present__2.txt create mode 100644 tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_controller_file_with_model__1.txt create mode 100644 tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_controller_file_with_model_using_shortcut_option__1.txt create mode 100644 tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_correct_fillable_fields__1.txt create mode 100644 tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_correct_migration_file_name_with_multiple_words_model__1.txt create mode 100644 tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_migration_file_with_model__1.txt create mode 100644 tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_migration_file_with_model_using_shortcut_option__1.txt create mode 100644 tests/Commands/__snapshots__/ModuleDeleteCommandTest__it_deletes_modules_from_status_file__1.txt create mode 100644 tests/Commands/__snapshots__/ModuleDeleteCommandTest__it_deletes_modules_from_status_file__2.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_module_with_resources__1.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_module_with_resources__2.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_module_with_resources__3.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_module_with_resources__4.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_route_file__1.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_correct_composerjson_file__1.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_files__1.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_namespace_using_studly_case__1.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_resources__1.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_resources__2.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_resources__3.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_resources__4.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources__1.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources__2.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources__3.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources__4.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources_when_adding_more_than_one_option__1.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources_when_adding_more_than_one_option__2.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources_when_adding_more_than_one_option__3.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources_when_adding_more_than_one_option__4.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_route_file__1.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_webpack_file__1.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generes_module_with_new_provider_location__1.txt create mode 100644 tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generes_module_with_new_provider_location__2.txt create mode 100644 tests/Commands/__snapshots__/NotificationMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/NotificationMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/NotificationMakeCommandTest__it_generated_correct_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/PolicyMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/PolicyMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/PolicyMakeCommandTest__it_makes_policy__1.txt create mode 100644 tests/Commands/__snapshots__/ProviderMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/ProviderMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/ProviderMakeCommandTest__it_can_have_custom_migration_resources_location_paths__1.txt create mode 100644 tests/Commands/__snapshots__/ProviderMakeCommandTest__it_generated_correct_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/ProviderMakeCommandTest__it_generates_a_master_service_provider_with_resource_loading__1.txt create mode 100644 tests/Commands/__snapshots__/RequestMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/RequestMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/RequestMakeCommandTest__it_generated_correct_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/ResourceMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/ResourceMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/ResourceMakeCommandTest__it_can_generate_a_collection_resource_class__1.txt create mode 100644 tests/Commands/__snapshots__/ResourceMakeCommandTest__it_generated_correct_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_change_the_custom_controller_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_overwrite_file__1.txt create mode 100644 tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_overwrite_route_file_names__1.txt create mode 100644 tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_generated_correct_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/RuleMakeCommandTest__it_can_change_the_default_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/RuleMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/RuleMakeCommandTest__it_makes_rule__1.txt create mode 100644 tests/Commands/__snapshots__/TestMakeCommandTest__it_can_change_the_default_feature_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/TestMakeCommandTest__it_can_change_the_default_feature_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/TestMakeCommandTest__it_can_change_the_default_unit_namespace__1.txt create mode 100644 tests/Commands/__snapshots__/TestMakeCommandTest__it_can_change_the_default_unit_namespace_specific__1.txt create mode 100644 tests/Commands/__snapshots__/TestMakeCommandTest__it_generated_correct_feature_file_with_content__1.txt create mode 100644 tests/Commands/__snapshots__/TestMakeCommandTest__it_generated_correct_unit_file_with_content__1.txt diff --git a/tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_disabling__1.txt b/tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_disabling__1.txt new file mode 100644 index 000000000..df07c139d --- /dev/null +++ b/tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_disabling__1.txt @@ -0,0 +1,3 @@ +{ + "Recipe": false +} \ No newline at end of file diff --git a/tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_disabling__2.txt b/tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_disabling__2.txt new file mode 100644 index 000000000..df07c139d --- /dev/null +++ b/tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_disabling__2.txt @@ -0,0 +1,3 @@ +{ + "Recipe": false +} \ No newline at end of file diff --git a/tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_enabling__1.txt b/tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_enabling__1.txt new file mode 100644 index 000000000..57b480388 --- /dev/null +++ b/tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_enabling__1.txt @@ -0,0 +1,3 @@ +{ + "Recipe": true +} \ No newline at end of file diff --git a/tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_enabling__2.txt b/tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_enabling__2.txt new file mode 100644 index 000000000..57b480388 --- /dev/null +++ b/tests/Activators/__snapshots__/FileActivatorTest__it_creates_valid_json_file_after_enabling__2.txt @@ -0,0 +1,3 @@ +{ + "Recipe": true +} \ No newline at end of file diff --git a/tests/Commands/__snapshots__/CommandMakeCommandTest__it_can_change_the_default_namespace__1.txt b/tests/Commands/__snapshots__/CommandMakeCommandTest__it_can_change_the_default_namespace__1.txt new file mode 100644 index 000000000..945c487a7 --- /dev/null +++ b/tests/Commands/__snapshots__/CommandMakeCommandTest__it_can_change_the_default_namespace__1.txt @@ -0,0 +1,68 @@ +view('view.name'); + } +} diff --git a/tests/Commands/__snapshots__/MailMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt b/tests/Commands/__snapshots__/MailMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt new file mode 100644 index 000000000..1247d2e77 --- /dev/null +++ b/tests/Commands/__snapshots__/MailMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt @@ -0,0 +1,33 @@ +view('view.name'); + } +} diff --git a/tests/Commands/__snapshots__/MailMakeCommandTest__it_generated_correct_file_with_content__1.txt b/tests/Commands/__snapshots__/MailMakeCommandTest__it_generated_correct_file_with_content__1.txt new file mode 100644 index 000000000..9fe735a64 --- /dev/null +++ b/tests/Commands/__snapshots__/MailMakeCommandTest__it_generated_correct_file_with_content__1.txt @@ -0,0 +1,33 @@ +view('view.name'); + } +} diff --git a/tests/Commands/__snapshots__/MiddlewareMakeCommandTest__it_can_change_the_default_namespace__1.txt b/tests/Commands/__snapshots__/MiddlewareMakeCommandTest__it_can_change_the_default_namespace__1.txt new file mode 100644 index 000000000..324fdf356 --- /dev/null +++ b/tests/Commands/__snapshots__/MiddlewareMakeCommandTest__it_can_change_the_default_namespace__1.txt @@ -0,0 +1,21 @@ +id(); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('posts'); + } +}; diff --git a/tests/Commands/__snapshots__/MigrationMakeCommandTest__it_generates_correct_default_migration_file_content__1.txt b/tests/Commands/__snapshots__/MigrationMakeCommandTest__it_generates_correct_default_migration_file_content__1.txt new file mode 100644 index 000000000..e46b052fc --- /dev/null +++ b/tests/Commands/__snapshots__/MigrationMakeCommandTest__it_generates_correct_default_migration_file_content__1.txt @@ -0,0 +1,28 @@ +bigIncrements('id'); + + $table->timestamps(); + }); + } +}; diff --git a/tests/Commands/__snapshots__/MigrationMakeCommandTest__it_generates_foreign_key_constraints__1.txt b/tests/Commands/__snapshots__/MigrationMakeCommandTest__it_generates_foreign_key_constraints__1.txt new file mode 100644 index 000000000..06a41628c --- /dev/null +++ b/tests/Commands/__snapshots__/MigrationMakeCommandTest__it_generates_foreign_key_constraints__1.txt @@ -0,0 +1,34 @@ +id(); + $table->integer('user_id')->unsigned(); + $table->foreign('user_id')->references('id')->on('users'); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('posts'); + } +}; diff --git a/tests/Commands/__snapshots__/ModelMakeCommandTest__it_can_change_the_default_namespace__1.txt b/tests/Commands/__snapshots__/ModelMakeCommandTest__it_can_change_the_default_namespace__1.txt new file mode 100644 index 000000000..7b64dbf18 --- /dev/null +++ b/tests/Commands/__snapshots__/ModelMakeCommandTest__it_can_change_the_default_namespace__1.txt @@ -0,0 +1,18 @@ +id(); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('posts'); + } +}; diff --git a/tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_controller_file_with_model__1.txt b/tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_controller_file_with_model__1.txt new file mode 100644 index 000000000..0bbb67f04 --- /dev/null +++ b/tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_controller_file_with_model__1.txt @@ -0,0 +1,79 @@ +id(); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('product_details'); + } +}; diff --git a/tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_migration_file_with_model__1.txt b/tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_migration_file_with_model__1.txt new file mode 100644 index 000000000..e61d263de --- /dev/null +++ b/tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_migration_file_with_model__1.txt @@ -0,0 +1,32 @@ +id(); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('posts'); + } +}; diff --git a/tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_migration_file_with_model_using_shortcut_option__1.txt b/tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_migration_file_with_model_using_shortcut_option__1.txt new file mode 100644 index 000000000..e61d263de --- /dev/null +++ b/tests/Commands/__snapshots__/ModelMakeCommandTest__it_generates_migration_file_with_model_using_shortcut_option__1.txt @@ -0,0 +1,32 @@ +id(); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('posts'); + } +}; diff --git a/tests/Commands/__snapshots__/ModuleDeleteCommandTest__it_deletes_modules_from_status_file__1.txt b/tests/Commands/__snapshots__/ModuleDeleteCommandTest__it_deletes_modules_from_status_file__1.txt new file mode 100644 index 000000000..e817d836b --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleDeleteCommandTest__it_deletes_modules_from_status_file__1.txt @@ -0,0 +1,3 @@ +{ + "WrongModule": true +} \ No newline at end of file diff --git a/tests/Commands/__snapshots__/ModuleDeleteCommandTest__it_deletes_modules_from_status_file__2.txt b/tests/Commands/__snapshots__/ModuleDeleteCommandTest__it_deletes_modules_from_status_file__2.txt new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleDeleteCommandTest__it_deletes_modules_from_status_file__2.txt @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_module_with_resources__1.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_module_with_resources__1.txt new file mode 100644 index 000000000..368c57180 --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_module_with_resources__1.txt @@ -0,0 +1,114 @@ +registerTranslations(); + $this->registerConfig(); + $this->registerViews(); + $this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations')); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->app->register(RouteServiceProvider::class); + } + + /** + * Register config. + * + * @return void + */ + protected function registerConfig() + { + $this->publishes([ + module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'), + ], 'config'); + $this->mergeConfigFrom( + module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower + ); + } + + /** + * Register views. + * + * @return void + */ + public function registerViews() + { + $viewPath = resource_path('views/modules/' . $this->moduleNameLower); + + $sourcePath = module_path($this->moduleName, 'Resources/views'); + + $this->publishes([ + $sourcePath => $viewPath + ], ['views', $this->moduleNameLower . '-module-views']); + + $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); + } + + /** + * Register translations. + * + * @return void + */ + public function registerTranslations() + { + $langPath = resource_path('lang/modules/' . $this->moduleNameLower); + + if (is_dir($langPath)) { + $this->loadTranslationsFrom($langPath, $this->moduleNameLower); + $this->loadJsonTranslationsFrom($langPath, $this->moduleNameLower); + } else { + $this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + } + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return []; + } + + private function getPublishableViewPaths(): array + { + $paths = []; + foreach (\Config::get('view.paths') as $path) { + if (is_dir($path . '/modules/' . $this->moduleNameLower)) { + $paths[] = $path . '/modules/' . $this->moduleNameLower; + } + } + return $paths; + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_module_with_resources__2.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_module_with_resources__2.txt new file mode 100644 index 000000000..7a087461e --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_module_with_resources__2.txt @@ -0,0 +1,60 @@ +call("OthersTableSeeder"); + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_module_with_resources__4.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_module_with_resources__4.txt new file mode 100644 index 000000000..288050277 --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_module_with_resources__4.txt @@ -0,0 +1,69 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::middleware('web') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::prefix('api') + ->middleware('api') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/api.php')); + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_route_file__1.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_route_file__1.txt new file mode 100644 index 000000000..dec192862 --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_api_route_file__1.txt @@ -0,0 +1,18 @@ +get('/blog', function (Request $request) { + return $request->user(); +}); \ No newline at end of file diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_correct_composerjson_file__1.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_correct_composerjson_file__1.txt new file mode 100644 index 000000000..acaf6a48b --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_correct_composerjson_file__1.txt @@ -0,0 +1,23 @@ +{ + "name": "nwidart/blog", + "description": "", + "authors": [ + { + "name": "Nicolas Widart", + "email": "n.widart@gmail.com" + } + ], + "extra": { + "laravel": { + "providers": [], + "aliases": { + + } + } + }, + "autoload": { + "psr-4": { + "Modules\\Blog\\": "" + } + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_files__1.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_files__1.txt new file mode 100644 index 000000000..afe890969 --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_files__1.txt @@ -0,0 +1,13 @@ +{ + "name": "Blog", + "alias": "blog", + "description": "", + "keywords": [], + "priority": 0, + "providers": [ + "Modules\\Blog\\Providers\\BlogServiceProvider" + ], + "aliases": {}, + "files": [], + "requires": [] +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_namespace_using_studly_case__1.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_namespace_using_studly_case__1.txt new file mode 100644 index 000000000..feea8f9fc --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_namespace_using_studly_case__1.txt @@ -0,0 +1,114 @@ +registerTranslations(); + $this->registerConfig(); + $this->registerViews(); + $this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations')); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->app->register(RouteServiceProvider::class); + } + + /** + * Register config. + * + * @return void + */ + protected function registerConfig() + { + $this->publishes([ + module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'), + ], 'config'); + $this->mergeConfigFrom( + module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower + ); + } + + /** + * Register views. + * + * @return void + */ + public function registerViews() + { + $viewPath = resource_path('views/modules/' . $this->moduleNameLower); + + $sourcePath = module_path($this->moduleName, 'Resources/views'); + + $this->publishes([ + $sourcePath => $viewPath + ], ['views', $this->moduleNameLower . '-module-views']); + + $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); + } + + /** + * Register translations. + * + * @return void + */ + public function registerTranslations() + { + $langPath = resource_path('lang/modules/' . $this->moduleNameLower); + + if (is_dir($langPath)) { + $this->loadTranslationsFrom($langPath, $this->moduleNameLower); + $this->loadJsonTranslationsFrom($langPath, $this->moduleNameLower); + } else { + $this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + } + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return []; + } + + private function getPublishableViewPaths(): array + { + $paths = []; + foreach (\Config::get('view.paths') as $path) { + if (is_dir($path . '/modules/' . $this->moduleNameLower)) { + $paths[] = $path . '/modules/' . $this->moduleNameLower; + } + } + return $paths; + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_resources__1.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_resources__1.txt new file mode 100644 index 000000000..368c57180 --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_resources__1.txt @@ -0,0 +1,114 @@ +registerTranslations(); + $this->registerConfig(); + $this->registerViews(); + $this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations')); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->app->register(RouteServiceProvider::class); + } + + /** + * Register config. + * + * @return void + */ + protected function registerConfig() + { + $this->publishes([ + module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'), + ], 'config'); + $this->mergeConfigFrom( + module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower + ); + } + + /** + * Register views. + * + * @return void + */ + public function registerViews() + { + $viewPath = resource_path('views/modules/' . $this->moduleNameLower); + + $sourcePath = module_path($this->moduleName, 'Resources/views'); + + $this->publishes([ + $sourcePath => $viewPath + ], ['views', $this->moduleNameLower . '-module-views']); + + $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); + } + + /** + * Register translations. + * + * @return void + */ + public function registerTranslations() + { + $langPath = resource_path('lang/modules/' . $this->moduleNameLower); + + if (is_dir($langPath)) { + $this->loadTranslationsFrom($langPath, $this->moduleNameLower); + $this->loadJsonTranslationsFrom($langPath, $this->moduleNameLower); + } else { + $this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + } + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return []; + } + + private function getPublishableViewPaths(): array + { + $paths = []; + foreach (\Config::get('view.paths') as $path) { + if (is_dir($path . '/modules/' . $this->moduleNameLower)) { + $paths[] = $path . '/modules/' . $this->moduleNameLower; + } + } + return $paths; + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_resources__2.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_resources__2.txt new file mode 100644 index 000000000..fa3f878dd --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_resources__2.txt @@ -0,0 +1,79 @@ +call("OthersTableSeeder"); + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_resources__4.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_resources__4.txt new file mode 100644 index 000000000..288050277 --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_resources__4.txt @@ -0,0 +1,69 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::middleware('web') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::prefix('api') + ->middleware('api') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/api.php')); + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources__1.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources__1.txt new file mode 100644 index 000000000..368c57180 --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources__1.txt @@ -0,0 +1,114 @@ +registerTranslations(); + $this->registerConfig(); + $this->registerViews(); + $this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations')); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->app->register(RouteServiceProvider::class); + } + + /** + * Register config. + * + * @return void + */ + protected function registerConfig() + { + $this->publishes([ + module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'), + ], 'config'); + $this->mergeConfigFrom( + module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower + ); + } + + /** + * Register views. + * + * @return void + */ + public function registerViews() + { + $viewPath = resource_path('views/modules/' . $this->moduleNameLower); + + $sourcePath = module_path($this->moduleName, 'Resources/views'); + + $this->publishes([ + $sourcePath => $viewPath + ], ['views', $this->moduleNameLower . '-module-views']); + + $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); + } + + /** + * Register translations. + * + * @return void + */ + public function registerTranslations() + { + $langPath = resource_path('lang/modules/' . $this->moduleNameLower); + + if (is_dir($langPath)) { + $this->loadTranslationsFrom($langPath, $this->moduleNameLower); + $this->loadJsonTranslationsFrom($langPath, $this->moduleNameLower); + } else { + $this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + } + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return []; + } + + private function getPublishableViewPaths(): array + { + $paths = []; + foreach (\Config::get('view.paths') as $path) { + if (is_dir($path . '/modules/' . $this->moduleNameLower)) { + $paths[] = $path . '/modules/' . $this->moduleNameLower; + } + } + return $paths; + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources__2.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources__2.txt new file mode 100644 index 000000000..fa3f878dd --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources__2.txt @@ -0,0 +1,79 @@ +call("OthersTableSeeder"); + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources__4.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources__4.txt new file mode 100644 index 000000000..288050277 --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources__4.txt @@ -0,0 +1,69 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::middleware('web') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::prefix('api') + ->middleware('api') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/api.php')); + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources_when_adding_more_than_one_option__1.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources_when_adding_more_than_one_option__1.txt new file mode 100644 index 000000000..368c57180 --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources_when_adding_more_than_one_option__1.txt @@ -0,0 +1,114 @@ +registerTranslations(); + $this->registerConfig(); + $this->registerViews(); + $this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations')); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->app->register(RouteServiceProvider::class); + } + + /** + * Register config. + * + * @return void + */ + protected function registerConfig() + { + $this->publishes([ + module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'), + ], 'config'); + $this->mergeConfigFrom( + module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower + ); + } + + /** + * Register views. + * + * @return void + */ + public function registerViews() + { + $viewPath = resource_path('views/modules/' . $this->moduleNameLower); + + $sourcePath = module_path($this->moduleName, 'Resources/views'); + + $this->publishes([ + $sourcePath => $viewPath + ], ['views', $this->moduleNameLower . '-module-views']); + + $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); + } + + /** + * Register translations. + * + * @return void + */ + public function registerTranslations() + { + $langPath = resource_path('lang/modules/' . $this->moduleNameLower); + + if (is_dir($langPath)) { + $this->loadTranslationsFrom($langPath, $this->moduleNameLower); + $this->loadJsonTranslationsFrom($langPath, $this->moduleNameLower); + } else { + $this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + } + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return []; + } + + private function getPublishableViewPaths(): array + { + $paths = []; + foreach (\Config::get('view.paths') as $path) { + if (is_dir($path . '/modules/' . $this->moduleNameLower)) { + $paths[] = $path . '/modules/' . $this->moduleNameLower; + } + } + return $paths; + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources_when_adding_more_than_one_option__2.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources_when_adding_more_than_one_option__2.txt new file mode 100644 index 000000000..fa3f878dd --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources_when_adding_more_than_one_option__2.txt @@ -0,0 +1,79 @@ +call("OthersTableSeeder"); + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources_when_adding_more_than_one_option__4.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources_when_adding_more_than_one_option__4.txt new file mode 100644 index 000000000..288050277 --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_module_with_resources_when_adding_more_than_one_option__4.txt @@ -0,0 +1,69 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::middleware('web') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::prefix('api') + ->middleware('api') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/api.php')); + } +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_route_file__1.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_route_file__1.txt new file mode 100644 index 000000000..d4d641ff5 --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_web_route_file__1.txt @@ -0,0 +1,16 @@ +group(function() { + Route::get('/', 'BlogController@index'); +}); diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_webpack_file__1.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_webpack_file__1.txt new file mode 100644 index 000000000..2a6d6d7f7 --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_webpack_file__1.txt @@ -0,0 +1,14 @@ +const dotenvExpand = require('dotenv-expand'); +dotenvExpand(require('dotenv').config({ path: '../../.env'/*, debug: true*/})); + +const mix = require('laravel-mix'); +require('laravel-mix-merge-manifest'); + +mix.setPublicPath('../../public').mergeManifest(); + +mix.js(__dirname + '/Resources/assets/js/app.js', 'js/blog.js') + .sass( __dirname + '/Resources/assets/sass/app.scss', 'css/blog.css'); + +if (mix.inProduction()) { + mix.version(); +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generes_module_with_new_provider_location__1.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generes_module_with_new_provider_location__1.txt new file mode 100644 index 000000000..66f3c7fe2 --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generes_module_with_new_provider_location__1.txt @@ -0,0 +1,13 @@ +{ + "name": "Blog", + "alias": "blog", + "description": "", + "keywords": [], + "priority": 0, + "providers": [ + "Modules\\Blog\\Base\\Providers\\BlogServiceProvider" + ], + "aliases": {}, + "files": [], + "requires": [] +} diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generes_module_with_new_provider_location__2.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generes_module_with_new_provider_location__2.txt new file mode 100644 index 000000000..acaf6a48b --- /dev/null +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generes_module_with_new_provider_location__2.txt @@ -0,0 +1,23 @@ +{ + "name": "nwidart/blog", + "description": "", + "authors": [ + { + "name": "Nicolas Widart", + "email": "n.widart@gmail.com" + } + ], + "extra": { + "laravel": { + "providers": [], + "aliases": { + + } + } + }, + "autoload": { + "psr-4": { + "Modules\\Blog\\": "" + } + } +} diff --git a/tests/Commands/__snapshots__/NotificationMakeCommandTest__it_can_change_the_default_namespace__1.txt b/tests/Commands/__snapshots__/NotificationMakeCommandTest__it_can_change_the_default_namespace__1.txt new file mode 100644 index 000000000..8b9169efd --- /dev/null +++ b/tests/Commands/__snapshots__/NotificationMakeCommandTest__it_can_change_the_default_namespace__1.txt @@ -0,0 +1,61 @@ +line('The introduction to the notification.') + ->action('Notification Action', 'https://laravel.com') + ->line('Thank you for using our application!'); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/tests/Commands/__snapshots__/NotificationMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt b/tests/Commands/__snapshots__/NotificationMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt new file mode 100644 index 000000000..8b9169efd --- /dev/null +++ b/tests/Commands/__snapshots__/NotificationMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt @@ -0,0 +1,61 @@ +line('The introduction to the notification.') + ->action('Notification Action', 'https://laravel.com') + ->line('Thank you for using our application!'); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/tests/Commands/__snapshots__/NotificationMakeCommandTest__it_generated_correct_file_with_content__1.txt b/tests/Commands/__snapshots__/NotificationMakeCommandTest__it_generated_correct_file_with_content__1.txt new file mode 100644 index 000000000..961b05228 --- /dev/null +++ b/tests/Commands/__snapshots__/NotificationMakeCommandTest__it_generated_correct_file_with_content__1.txt @@ -0,0 +1,61 @@ +line('The introduction to the notification.') + ->action('Notification Action', 'https://laravel.com') + ->line('Thank you for using our application!'); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/tests/Commands/__snapshots__/PolicyMakeCommandTest__it_can_change_the_default_namespace__1.txt b/tests/Commands/__snapshots__/PolicyMakeCommandTest__it_can_change_the_default_namespace__1.txt new file mode 100644 index 000000000..1697bce2c --- /dev/null +++ b/tests/Commands/__snapshots__/PolicyMakeCommandTest__it_can_change_the_default_namespace__1.txt @@ -0,0 +1,20 @@ +registerTranslations(); + $this->registerConfig(); + $this->registerViews(); + $this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations')); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->app->register(RouteServiceProvider::class); + } + + /** + * Register config. + * + * @return void + */ + protected function registerConfig() + { + $this->publishes([ + module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'), + ], 'config'); + $this->mergeConfigFrom( + module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower + ); + } + + /** + * Register views. + * + * @return void + */ + public function registerViews() + { + $viewPath = resource_path('views/modules/' . $this->moduleNameLower); + + $sourcePath = module_path($this->moduleName, 'Resources/views'); + + $this->publishes([ + $sourcePath => $viewPath + ], ['views', $this->moduleNameLower . '-module-views']); + + $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); + } + + /** + * Register translations. + * + * @return void + */ + public function registerTranslations() + { + $langPath = resource_path('lang/modules/' . $this->moduleNameLower); + + if (is_dir($langPath)) { + $this->loadTranslationsFrom($langPath, $this->moduleNameLower); + $this->loadJsonTranslationsFrom($langPath, $this->moduleNameLower); + } else { + $this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + } + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return []; + } + + private function getPublishableViewPaths(): array + { + $paths = []; + foreach (\Config::get('view.paths') as $path) { + if (is_dir($path . '/modules/' . $this->moduleNameLower)) { + $paths[] = $path . '/modules/' . $this->moduleNameLower; + } + } + return $paths; + } +} diff --git a/tests/Commands/__snapshots__/ProviderMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt b/tests/Commands/__snapshots__/ProviderMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt new file mode 100644 index 000000000..0e6a3f543 --- /dev/null +++ b/tests/Commands/__snapshots__/ProviderMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt @@ -0,0 +1,114 @@ +registerTranslations(); + $this->registerConfig(); + $this->registerViews(); + $this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations')); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->app->register(RouteServiceProvider::class); + } + + /** + * Register config. + * + * @return void + */ + protected function registerConfig() + { + $this->publishes([ + module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'), + ], 'config'); + $this->mergeConfigFrom( + module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower + ); + } + + /** + * Register views. + * + * @return void + */ + public function registerViews() + { + $viewPath = resource_path('views/modules/' . $this->moduleNameLower); + + $sourcePath = module_path($this->moduleName, 'Resources/views'); + + $this->publishes([ + $sourcePath => $viewPath + ], ['views', $this->moduleNameLower . '-module-views']); + + $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); + } + + /** + * Register translations. + * + * @return void + */ + public function registerTranslations() + { + $langPath = resource_path('lang/modules/' . $this->moduleNameLower); + + if (is_dir($langPath)) { + $this->loadTranslationsFrom($langPath, $this->moduleNameLower); + $this->loadJsonTranslationsFrom($langPath, $this->moduleNameLower); + } else { + $this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + } + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return []; + } + + private function getPublishableViewPaths(): array + { + $paths = []; + foreach (\Config::get('view.paths') as $path) { + if (is_dir($path . '/modules/' . $this->moduleNameLower)) { + $paths[] = $path . '/modules/' . $this->moduleNameLower; + } + } + return $paths; + } +} diff --git a/tests/Commands/__snapshots__/ProviderMakeCommandTest__it_can_have_custom_migration_resources_location_paths__1.txt b/tests/Commands/__snapshots__/ProviderMakeCommandTest__it_can_have_custom_migration_resources_location_paths__1.txt new file mode 100644 index 000000000..f98f2a213 --- /dev/null +++ b/tests/Commands/__snapshots__/ProviderMakeCommandTest__it_can_have_custom_migration_resources_location_paths__1.txt @@ -0,0 +1,114 @@ +registerTranslations(); + $this->registerConfig(); + $this->registerViews(); + $this->loadMigrationsFrom(module_path($this->moduleName, 'migrations')); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->app->register(RouteServiceProvider::class); + } + + /** + * Register config. + * + * @return void + */ + protected function registerConfig() + { + $this->publishes([ + module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'), + ], 'config'); + $this->mergeConfigFrom( + module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower + ); + } + + /** + * Register views. + * + * @return void + */ + public function registerViews() + { + $viewPath = resource_path('views/modules/' . $this->moduleNameLower); + + $sourcePath = module_path($this->moduleName, 'Resources/views'); + + $this->publishes([ + $sourcePath => $viewPath + ], ['views', $this->moduleNameLower . '-module-views']); + + $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); + } + + /** + * Register translations. + * + * @return void + */ + public function registerTranslations() + { + $langPath = resource_path('lang/modules/' . $this->moduleNameLower); + + if (is_dir($langPath)) { + $this->loadTranslationsFrom($langPath, $this->moduleNameLower); + $this->loadJsonTranslationsFrom($langPath, $this->moduleNameLower); + } else { + $this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + } + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return []; + } + + private function getPublishableViewPaths(): array + { + $paths = []; + foreach (\Config::get('view.paths') as $path) { + if (is_dir($path . '/modules/' . $this->moduleNameLower)) { + $paths[] = $path . '/modules/' . $this->moduleNameLower; + } + } + return $paths; + } +} diff --git a/tests/Commands/__snapshots__/ProviderMakeCommandTest__it_generated_correct_file_with_content__1.txt b/tests/Commands/__snapshots__/ProviderMakeCommandTest__it_generated_correct_file_with_content__1.txt new file mode 100644 index 000000000..3019d551b --- /dev/null +++ b/tests/Commands/__snapshots__/ProviderMakeCommandTest__it_generated_correct_file_with_content__1.txt @@ -0,0 +1,28 @@ +registerTranslations(); + $this->registerConfig(); + $this->registerViews(); + $this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations')); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->app->register(RouteServiceProvider::class); + } + + /** + * Register config. + * + * @return void + */ + protected function registerConfig() + { + $this->publishes([ + module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'), + ], 'config'); + $this->mergeConfigFrom( + module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower + ); + } + + /** + * Register views. + * + * @return void + */ + public function registerViews() + { + $viewPath = resource_path('views/modules/' . $this->moduleNameLower); + + $sourcePath = module_path($this->moduleName, 'Resources/views'); + + $this->publishes([ + $sourcePath => $viewPath + ], ['views', $this->moduleNameLower . '-module-views']); + + $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); + } + + /** + * Register translations. + * + * @return void + */ + public function registerTranslations() + { + $langPath = resource_path('lang/modules/' . $this->moduleNameLower); + + if (is_dir($langPath)) { + $this->loadTranslationsFrom($langPath, $this->moduleNameLower); + $this->loadJsonTranslationsFrom($langPath, $this->moduleNameLower); + } else { + $this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower); + } + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return []; + } + + private function getPublishableViewPaths(): array + { + $paths = []; + foreach (\Config::get('view.paths') as $path) { + if (is_dir($path . '/modules/' . $this->moduleNameLower)) { + $paths[] = $path . '/modules/' . $this->moduleNameLower; + } + } + return $paths; + } +} diff --git a/tests/Commands/__snapshots__/RequestMakeCommandTest__it_can_change_the_default_namespace__1.txt b/tests/Commands/__snapshots__/RequestMakeCommandTest__it_can_change_the_default_namespace__1.txt new file mode 100644 index 000000000..454c125e9 --- /dev/null +++ b/tests/Commands/__snapshots__/RequestMakeCommandTest__it_can_change_the_default_namespace__1.txt @@ -0,0 +1,30 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::middleware('web') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::prefix('api') + ->middleware('api') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/api.php')); + } +} diff --git a/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_change_the_default_namespace__1.txt b/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_change_the_default_namespace__1.txt new file mode 100644 index 000000000..ebc5786a4 --- /dev/null +++ b/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_change_the_default_namespace__1.txt @@ -0,0 +1,69 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::middleware('web') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::prefix('api') + ->middleware('api') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/api.php')); + } +} diff --git a/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt b/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt new file mode 100644 index 000000000..ebc5786a4 --- /dev/null +++ b/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_change_the_default_namespace_specific__1.txt @@ -0,0 +1,69 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::middleware('web') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::prefix('api') + ->middleware('api') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/api.php')); + } +} diff --git a/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_overwrite_file__1.txt b/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_overwrite_file__1.txt new file mode 100644 index 000000000..99fb6b8d6 --- /dev/null +++ b/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_overwrite_file__1.txt @@ -0,0 +1,69 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::middleware('web') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/SuperRoutes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::prefix('api') + ->middleware('api') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/api.php')); + } +} diff --git a/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_overwrite_route_file_names__1.txt b/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_overwrite_route_file_names__1.txt new file mode 100644 index 000000000..4caf69906 --- /dev/null +++ b/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_can_overwrite_route_file_names__1.txt @@ -0,0 +1,69 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::middleware('web') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/SuperRoutes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::prefix('api') + ->middleware('api') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/SuperRoutes/api.php')); + } +} diff --git a/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_generated_correct_file_with_content__1.txt b/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_generated_correct_file_with_content__1.txt new file mode 100644 index 000000000..288050277 --- /dev/null +++ b/tests/Commands/__snapshots__/RouteProviderMakeCommandTest__it_generated_correct_file_with_content__1.txt @@ -0,0 +1,69 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::middleware('web') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::prefix('api') + ->middleware('api') + ->namespace($this->moduleNamespace) + ->group(module_path('Blog', '/Routes/api.php')); + } +} diff --git a/tests/Commands/__snapshots__/RuleMakeCommandTest__it_can_change_the_default_namespace__1.txt b/tests/Commands/__snapshots__/RuleMakeCommandTest__it_can_change_the_default_namespace__1.txt new file mode 100644 index 000000000..df545f507 --- /dev/null +++ b/tests/Commands/__snapshots__/RuleMakeCommandTest__it_can_change_the_default_namespace__1.txt @@ -0,0 +1,40 @@ +get('/'); + + $response->assertStatus(200); + } +} diff --git a/tests/Commands/__snapshots__/TestMakeCommandTest__it_can_change_the_default_feature_namespace_specific__1.txt b/tests/Commands/__snapshots__/TestMakeCommandTest__it_can_change_the_default_feature_namespace_specific__1.txt new file mode 100644 index 000000000..4ccecd857 --- /dev/null +++ b/tests/Commands/__snapshots__/TestMakeCommandTest__it_can_change_the_default_feature_namespace_specific__1.txt @@ -0,0 +1,22 @@ +get('/'); + + $response->assertStatus(200); + } +} diff --git a/tests/Commands/__snapshots__/TestMakeCommandTest__it_can_change_the_default_unit_namespace__1.txt b/tests/Commands/__snapshots__/TestMakeCommandTest__it_can_change_the_default_unit_namespace__1.txt new file mode 100644 index 000000000..273dc9657 --- /dev/null +++ b/tests/Commands/__snapshots__/TestMakeCommandTest__it_can_change_the_default_unit_namespace__1.txt @@ -0,0 +1,20 @@ +assertTrue(true); + } +} diff --git a/tests/Commands/__snapshots__/TestMakeCommandTest__it_can_change_the_default_unit_namespace_specific__1.txt b/tests/Commands/__snapshots__/TestMakeCommandTest__it_can_change_the_default_unit_namespace_specific__1.txt new file mode 100644 index 000000000..273dc9657 --- /dev/null +++ b/tests/Commands/__snapshots__/TestMakeCommandTest__it_can_change_the_default_unit_namespace_specific__1.txt @@ -0,0 +1,20 @@ +assertTrue(true); + } +} diff --git a/tests/Commands/__snapshots__/TestMakeCommandTest__it_generated_correct_feature_file_with_content__1.txt b/tests/Commands/__snapshots__/TestMakeCommandTest__it_generated_correct_feature_file_with_content__1.txt new file mode 100644 index 000000000..04d4c6b90 --- /dev/null +++ b/tests/Commands/__snapshots__/TestMakeCommandTest__it_generated_correct_feature_file_with_content__1.txt @@ -0,0 +1,22 @@ +get('/'); + + $response->assertStatus(200); + } +} diff --git a/tests/Commands/__snapshots__/TestMakeCommandTest__it_generated_correct_unit_file_with_content__1.txt b/tests/Commands/__snapshots__/TestMakeCommandTest__it_generated_correct_unit_file_with_content__1.txt new file mode 100644 index 000000000..fcbfc0da3 --- /dev/null +++ b/tests/Commands/__snapshots__/TestMakeCommandTest__it_generated_correct_unit_file_with_content__1.txt @@ -0,0 +1,20 @@ +assertTrue(true); + } +}