mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-24 02:49:07 +01:00
7098b3ee79
The web-root directory now contains URL rewrite stuff. All PHP & static files are in root src directory and are served via LSurl routes.
30 lines
1.1 KiB
PHP
30 lines
1.1 KiB
PHP
<?php
|
|
|
|
require(realpath(dirname(__FILE__)).'/../src/includes/functions.php');
|
|
|
|
$tests=array(
|
|
// array(format, test val, test good result)
|
|
array('%{toto:2}', 'abcdef', 'ab'),
|
|
array('%{toto:3:-2}', 'abcdef', 'bc'),
|
|
array('%{toto:1:0}', 'abcdef', 'bcdef'),
|
|
array('%{toto:-2}', 'abcdef', 'ef'),
|
|
array('%{toto:-3:2}', 'abcdef', 'de'),
|
|
array('%{toto:-1}', 'abcdef', 'f'),
|
|
array('%{toto!}', '<a>tiTé', '<A>TITÉ'),
|
|
array('%{toto_}', '<a>tiTé', '<a>tité'),
|
|
array('%{toto~}', '<a>tiTé', '<a>tiTe'),
|
|
array('%{toto%}', '<a>tiTé', '<a>tiTé'),
|
|
array('%{toto!%}', '<a>tiTé', '<A>TITÉ'),
|
|
array('%{toto!~}', '<a>tiTé', '<A>TITE'),
|
|
array('%{toto!~%}', '<a>tiTé', '<A>TITE'),
|
|
array('%{toto:1!%}', '<a>tiTé', '<'),
|
|
array('%{toto:1:0!~}', '<a>tiTé', 'A>TITE'),
|
|
array('%{toto:-3!~%}', '<a>tiTé', 'ITE'),
|
|
array('%{toto:-3:2!~%}', '<a>tiTé', 'IT'),
|
|
);
|
|
|
|
foreach ($tests as $test) {
|
|
$result = getFData($test[0], $test[1]);
|
|
$ok = (($result == $test[2])?'OK':"\n\t!!!! NOK !!!!");
|
|
echo "Test : \"$test[0]\" ($test[2]) : \"$test[1]\" -> \"$result\" => $ok\n";
|
|
}
|