Skip to content
Snippets Groups Projects

7512 php83 update

Merged Hahn Axel (hahn) requested to merge 7512-php83-update into master
1 file
+ 28
1
Compare changes
  • Side-by-side
  • Inline
+ 28
1
<?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