|
| 1 | +#! /usr/bin/env bash |
| 2 | + |
| 3 | +cd "$(dirname "${BASH_SOURCE[0]}")/.." && project_root_dir=$PWD |
| 4 | + |
| 5 | +tests_dir="${project_root_dir}/tests" |
| 6 | +cd ${tests_dir} |
| 7 | + |
| 8 | +## Includes |
| 9 | +source include/global_variables.sh |
| 10 | +source include/configuration.sh |
| 11 | +source include/helpers.sh |
| 12 | +source include/assertions.sh |
| 13 | + |
| 14 | +original_devbox_dir="${devbox_dir}" |
| 15 | +source ./../scripts/functions.sh |
| 16 | +devbox_dir=${original_devbox_dir} |
| 17 | +cd ${tests_dir} |
| 18 | + |
| 19 | +## Setup and tear down |
| 20 | + |
| 21 | +function oneTimeSetUp |
| 22 | +{ |
| 23 | + clearLogs |
| 24 | +} |
| 25 | + |
| 26 | +function setUp() |
| 27 | +{ |
| 28 | + debug_devbox_project=0 |
| 29 | + skip_codebase_stash=0 |
| 30 | +} |
| 31 | + |
| 32 | +function tearDown() |
| 33 | +{ |
| 34 | + assertNoErrorsInLogs |
| 35 | + |
| 36 | + if [[ ${delete_test_project_on_tear_down} -eq 1 ]]; then |
| 37 | + stashLogs |
| 38 | + stashMagentoCodebase |
| 39 | + clearTestTmp |
| 40 | + fi |
| 41 | + |
| 42 | + # TODO: change globally when https://github.com/paliarush/magento2-vagrant-for-developers/issues/58 is unblocked |
| 43 | + devbox_dir="${tests_dir}/tmp/test/magento2-devbox" |
| 44 | +} |
| 45 | + |
| 46 | +function oneTimeTearDown() |
| 47 | +{ |
| 48 | + echo " |
| 49 | +See logs in ${logs_dir}" |
| 50 | +} |
| 51 | + |
| 52 | +## Tests |
| 53 | + |
| 54 | +function testNoCustomConfigBasicTest() |
| 55 | +{ |
| 56 | + current_config_name="no_custom_config" |
| 57 | + current_codebase="ee" |
| 58 | + installEnvironment |
| 59 | +# assertVarnishDisabled |
| 60 | + executeBasicCommonAssertions |
| 61 | + assertMagentoEditionIsCE |
| 62 | + assertCeSampleDataNotInstalled |
| 63 | + assertRedisCacheIsEnabled |
| 64 | + |
| 65 | + emulateEeRepoCloning |
| 66 | + assertMagentoSwitchToEeWorks |
| 67 | + assertMagentoFrontendAccessible |
| 68 | + assertMagentoEditionIsEE |
| 69 | + |
| 70 | + assertMagentoSwitchToCeWorks |
| 71 | + assertMagentoFrontendAccessible |
| 72 | + assertMagentoEditionIsCE |
| 73 | +} |
| 74 | + |
| 75 | +## Call and Run all Tests |
| 76 | +source lib/shunit2/shunit2 |
0 commit comments