Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
redirect-handler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
redirect-handler
Merge requests
!5
7512 php83 update
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
7512 php83 update
7512-php83-update
into
master
Overview
0
Commits
8
Pipelines
0
Changes
1
Merged
Hahn Axel (hahn)
requested to merge
7512-php83-update
into
master
9 months ago
Overview
0
Commits
8
Pipelines
0
Changes
1
0
0
Merge request reports
Viewing commit
11f2cf97
Prev
Next
Show latest version
1 file
+
28
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
11f2cf97
add test script
· 11f2cf97
Hahn Axel (hahn)
authored
9 months ago
test/get_redirect.php
+
28
−
1
View file @ 11f2cf97
Edit in single-file editor
Open in Web IDE
Show full file
<?php
/**
*
* TEST
* Verify if a redirect works
*
* Usage:
* cd ./tests
* php get_redirect.php
*
*/
require_once
'../public_html/classes/redirect.class.php'
;
@@ -9,13 +15,20 @@ require_once '../public_html/classes/redirect.class.php';
// CONFIG
// ------------------------------------------------------------------------
$aTests
=
[
'www.example.com - static entry'
=>
[
'www.example.com - static entry
/mail
'
=>
[
'host'
=>
'www.example.com'
,
'request'
=>
'/mail'
,
'target'
=>
'https://www.example.com/webmail'
,
'code'
=>
301
,
],
'www.example.com - /mail2 should not match /mail but the regex'
=>
[
'host'
=>
'www.example.com'
,
'request'
=>
'/mail2'
,
'target'
=>
'https://www.example.com/'
,
'code'
=>
307
,
],
'www.example.com - regex'
=>
[
'host'
=>
'www.example.com'
,
'request'
=>
'/somethingold'
,
@@ -23,6 +36,20 @@ $aTests=[
'target'
=>
'https://www.example.com/'
,
'code'
=>
307
,
],
'www.example.com - /iml must match regex ^/iml'
=>
[
'host'
=>
'www.example.com'
,
'request'
=>
'/iml'
,
'target'
=>
'https://www.iml.unibe.ch/'
,
'code'
=>
307
,
],
'www.example.com - /iml2 must match regex ^/iml too'
=>
[
'host'
=>
'www.example.com'
,
'request'
=>
'/iml2'
,
'target'
=>
'https://www.iml.unibe.ch/'
,
'code'
=>
307
,
],
];
// ------------------------------------------------------------------------
Loading