-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Alex Skrypnyk <[email protected]>
- Loading branch information
1 parent
d0709ff
commit 0f3ae7b
Showing
5 changed files
with
153 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
#!/usr/bin/env bats | ||
|
||
load _helper | ||
|
||
export BATS_FIXTURE_EXPORT_CODEBASE_ENABLED=1 | ||
|
||
@test "ahoy assemble" { | ||
run ahoy assemble | ||
assert_success | ||
|
||
assert_output_contains "ASSEMBLE COMPLETE" | ||
assert_dir_exists "${BUILD_DIR}/build/vendor" | ||
assert_file_exists "${BUILD_DIR}/build/composer.json" | ||
assert_file_exists "${BUILD_DIR}/build/composer.lock" | ||
} | ||
|
||
@test "ahoy start" { | ||
run ahoy start | ||
assert_failure | ||
|
||
ahoy assemble | ||
run ahoy start | ||
assert_success | ||
|
||
assert_output_contains "ENVIRONMENT READY" | ||
} | ||
|
||
@test "ahoy stop" { | ||
run ahoy stop | ||
assert_success | ||
assert_output_contains "ENVIRONMENT STOPPED" | ||
|
||
ahoy assemble | ||
ahoy start | ||
|
||
run ahoy stop | ||
assert_success | ||
|
||
assert_output_contains "ENVIRONMENT STOPPED" | ||
} | ||
|
||
@test "ahoy lint, lint-fix" { | ||
ahoy assemble | ||
assert_success | ||
|
||
ahoy lint | ||
assert_success | ||
|
||
# shellcheck disable=SC2016 | ||
echo '$a=123;echo $a;' >>your_extension.module | ||
run ahoy lint | ||
assert_failure | ||
|
||
run ahoy lint-fix | ||
run ahoy lint | ||
assert_success | ||
} | ||
|
||
@test "ahoy build - basic workflow" { | ||
run ahoy build | ||
assert_success | ||
assert_output_contains "PROVISION COMPLETE" | ||
|
||
run ahoy drush status | ||
assert_success | ||
assert_output_contains "Database : Connected" | ||
assert_output_contains "Drupal bootstrap : Successful" | ||
|
||
run ahoy login | ||
assert_success | ||
assert_output_contains "user/reset/1/" | ||
|
||
ahoy lint | ||
assert_success | ||
|
||
ahoy test | ||
assert_success | ||
|
||
ahoy test-unit | ||
assert_success | ||
|
||
ahoy test-kernel | ||
assert_success | ||
|
||
ahoy test-functional | ||
assert_success | ||
} | ||
|
||
@test "ahoy test unit failure" { | ||
run ahoy assemble | ||
assert_success | ||
|
||
run ahoy test-unit | ||
assert_success | ||
|
||
sed -i -e "s/assertEquals/assertNotEquals/g" "${BUILD_DIR}/tests/src/Unit/YourExtensionServiceUnitTest.php" | ||
run ahoy test-unit | ||
assert_failure | ||
} | ||
|
||
@test "ahoy test functional failure" { | ||
run ahoy build | ||
assert_success | ||
|
||
run ahoy test-functional | ||
assert_success | ||
|
||
sed -i -e "s/responseContains/responseNotContains/g" "${BUILD_DIR}/tests/src/Functional/YourExtensionFunctionalTest.php" | ||
run ahoy test-functional | ||
assert_failure | ||
} | ||
|
||
@test "ahoy test kernel failure" { | ||
run ahoy build | ||
assert_success | ||
|
||
run ahoy test-kernel | ||
assert_success | ||
|
||
sed -i -e "s/assertEquals/assertNotEquals/g" "${BUILD_DIR}/tests/src/Kernel/YourExtensionServiceKernelTest.php" | ||
run ahoy test-kernel | ||
assert_failure | ||
} |
0f3ae7b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://drupal-extension-scaffold-docs.netlify.app as production
🚀 Deployed on https://663ad0a48680e98eed0bbed1--drupal-extension-scaffold-docs.netlify.app