Skip to content

Commit 3d64d07

Browse files
committed
fix: Use .localhost domain for behat
1 parent e19422d commit 3d64d07

File tree

3 files changed

+97
-3
lines changed

3 files changed

+97
-3
lines changed

compose/apache.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,49 +21,96 @@ services:
2121
totara:
2222
aliases:
2323
- totara54
24+
- totara54.localhost
2425
- totara54.debug
26+
- totara54.debug.localhost
2527
- totara54.behat
28+
- totara54.behat.localhost
2629
- totara54.behat.totaralms.com
2730
- totara55
31+
- totara55.localhost
2832
- totara55.debug
33+
- totara55.debug.localhost
2934
- totara55.behat
35+
- totara55.behat.localhost
3036
- totara55.behat.totaralms.com
3137
- totara56
38+
- totara56.localhost
3239
- totara56.debug
40+
- totara56.debug.localhost
3341
- totara56.behat
42+
- totara56.behat.localhost
3443
- totara56.behat.totaralms.com
3544
- totara70
45+
- totara70.localhost
3646
- totara70.debug
47+
- totara70.debug.localhost
3748
- totara70.behat
49+
- totara70.behat.localhost
3850
- totara70.behat.totaralms.com
3951
- totara71
52+
- totara71.localhost
4053
- totara71.debug
54+
- totara71.debug.localhost
4155
- totara71.behat
56+
- totara71.behat.localhost
4257
- totara71.behat.totaralms.com
4358
- totara72
59+
- totara72.localhost
4460
- totara72.debug
61+
- totara72.debug.localhost
4562
- totara72.behat
63+
- totara72.behat.localhost
4664
- totara72.behat.totaralms.com
4765
- totara73
66+
- totara73.localhost
4867
- totara73.debug
68+
- totara73.debug.localhost
4969
- totara73.behat
70+
- totara73.behat.localhost
5071
- totara73.behat.totaralms.com
5172
- totara74
73+
- totara74.localhost
5274
- totara74.debug
75+
- totara74.debug.localhost
5376
- totara74.behat
77+
- totara74.behat.localhost
5478
- totara74.behat.totaralms.com
5579
- totara80
80+
- totara80.localhost
81+
- totara80.debug
82+
- totara80.debug.localhost
5683
- totara80.behat
84+
- totara80.behat.localhost
5785
- totara80.behat.totaralms.com
5886
- totara81
87+
- totara81.localhost
88+
- totara81.debug
89+
- totara81.debug.localhost
5990
- totara81.behat
91+
- totara81.behat.localhost
6092
- totara81.behat.totaralms.com
6193
- totara82
94+
- totara82.localhost
95+
- totara82.debug
96+
- totara82.debug.localhost
6297
- totara82.behat
98+
- totara82.behat.localhost
6399
- totara82.behat.totaralms.com
64100
- totara83
101+
- totara83.localhost
102+
- totara83.debug
103+
- totara83.debug.localhost
65104
- totara83.behat
105+
- totara83.behat.localhost
66106
- totara83.behat.totaralms.com
107+
- totara84
108+
- totara84.localhost
109+
- totara84.debug
110+
- totara84.debug.localhost
111+
- totara84.behat
112+
- totara84.behat.localhost
113+
- totara84.behat.totaralms.com
67114

68115
volumes:
69116
totara-data:

compose/nginx.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,49 +22,96 @@ services:
2222
totara:
2323
aliases:
2424
- totara54
25+
- totara54.localhost
2526
- totara54.debug
27+
- totara54.debug.localhost
2628
- totara54.behat
29+
- totara54.behat.localhost
2730
- totara54.behat.totaralms.com
2831
- totara55
32+
- totara55.localhost
2933
- totara55.debug
34+
- totara55.debug.localhost
3035
- totara55.behat
36+
- totara55.behat.localhost
3137
- totara55.behat.totaralms.com
3238
- totara56
39+
- totara56.localhost
3340
- totara56.debug
41+
- totara56.debug.localhost
3442
- totara56.behat
43+
- totara56.behat.localhost
3544
- totara56.behat.totaralms.com
3645
- totara70
46+
- totara70.localhost
3747
- totara70.debug
48+
- totara70.debug.localhost
3849
- totara70.behat
50+
- totara70.behat.localhost
3951
- totara70.behat.totaralms.com
4052
- totara71
53+
- totara71.localhost
4154
- totara71.debug
55+
- totara71.debug.localhost
4256
- totara71.behat
57+
- totara71.behat.localhost
4358
- totara71.behat.totaralms.com
4459
- totara72
60+
- totara72.localhost
4561
- totara72.debug
62+
- totara72.debug.localhost
4663
- totara72.behat
64+
- totara72.behat.localhost
4765
- totara72.behat.totaralms.com
4866
- totara73
67+
- totara73.localhost
4968
- totara73.debug
69+
- totara73.debug.localhost
5070
- totara73.behat
71+
- totara73.behat.localhost
5172
- totara73.behat.totaralms.com
5273
- totara74
74+
- totara74.localhost
5375
- totara74.debug
76+
- totara74.debug.localhost
5477
- totara74.behat
78+
- totara74.behat.localhost
5579
- totara74.behat.totaralms.com
5680
- totara80
81+
- totara80.localhost
82+
- totara80.debug
83+
- totara80.debug.localhost
5784
- totara80.behat
85+
- totara80.behat.localhost
5886
- totara80.behat.totaralms.com
5987
- totara81
88+
- totara81.localhost
89+
- totara81.debug
90+
- totara81.debug.localhost
6091
- totara81.behat
92+
- totara81.behat.localhost
6193
- totara81.behat.totaralms.com
6294
- totara82
95+
- totara82.localhost
96+
- totara82.debug
97+
- totara82.debug.localhost
6398
- totara82.behat
99+
- totara82.behat.localhost
64100
- totara82.behat.totaralms.com
65101
- totara83
102+
- totara83.localhost
103+
- totara83.debug
104+
- totara83.debug.localhost
66105
- totara83.behat
106+
- totara83.behat.localhost
67107
- totara83.behat.totaralms.com
108+
- totara84
109+
- totara84.localhost
110+
- totara84.debug
111+
- totara84.debug.localhost
112+
- totara84.behat
113+
- totara84.behat.localhost
114+
- totara84.behat.totaralms.com
68115

69116
volumes:
70117
totara-data:

php/includes/config-after.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@
5454
}
5555

5656
/**
57-
* The wwwroot for behat is the same as the host, but with '.behat' added as a suffix (so 'totara73' becomes 'totara73.behat')
57+
* The wwwroot for behat is the same as the host, but with '.behat' added as a suffix (so 'totara73.localhost' becomes 'totara73.behat.localhost')
5858
* You shouldn't really need to change this.
5959
*/
60-
$CFG->behat_wwwroot = 'http://totara' . PHP_MAJOR_VERSION . PHP_MINOR_VERSION . '.behat';
60+
$CFG->behat_wwwroot = 'http://totara' . PHP_MAJOR_VERSION . PHP_MINOR_VERSION . '.behat.localhost';
6161
if ($DOCKER_DEV->is_multi_site) {
6262
$CFG->behat_wwwroot .= '/' . $DOCKER_DEV->site_name;
6363
}
@@ -258,7 +258,7 @@
258258

259259
$hostname = $_SERVER['HTTP_HOST'];
260260
$hostname_parts = explode('.', $hostname);
261-
if (end($hostname_parts) === 'behat') {
261+
if (end($hostname_parts) === 'behat' || prev($hostname_parts) === 'behat') {
262262
// redirect if using the behat URL
263263
$hostname = str_replace('.behat', '', $hostname);
264264
}

0 commit comments

Comments
 (0)