-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestUnit_PHP.php
67 lines (48 loc) · 2.42 KB
/
testUnit_PHP.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
// Проверка дали потребителя съществува
$libdir = "./../../save_dir_electronics/"; // Директория с файлове, които да НЕ са достъпни през WEB
$myurl = "interactiveelectronics.eu";
include ($libdir."defines.php");
include ($libdir."database.php");
include ($libdir."functions.php");
getPostIfSet(array('email', 'pass', 'name', 'q'));
echo "<br>Unit Тестове за проверка. Може да добавяте параметър и стойност. Пример: [email protected]<br><br>";
if ( isset ($email) ) {
echo "<br>email=($email)";
echo "<br>origText = ".$email.", cryptoText = ".cryptoText($email);
echo "<br>origText = ".$email.", decryptoText = ".deCryptoText($email);
}
if ( isset ($pass) ) {
echo "<br>pass=($pass)";
echo "<br>origText = ".$pass.", cryptoText = ".cryptoText($pass);
echo "<br>origText = ".$pass.", decryptoText = ".deCryptoText($pass);
}
if ( isset ($name) ) {
echo "<br>name=($name)";
echo "<br>origText = ".$name.", cryptoText = ".cryptoText($name);
echo "<br>origText = ".$name.", decryptoText = ".deCryptoText($name);
}
if ( isset ($q) ) {
echo "<br>Тестване на забранени думи в query=($q)";
if ( checkForbiddenQuery ($q) )
echo "<br>В query има ЗАБРАНЕНИ СИМВОЛИ.";
if ( checkText ($q) != "" )
echo "<br>В query има ЗАБРАНЕНИ СИМВОЛИ.";
}
echo "<br><br>Тестване на криптиране на текст :";
$clearText = "Varban Dubov Bukov";
echo "<br><br>clearText = ".$clearText.", cryptoText = ".cryptoText($clearText);
$clearText = "Alex Petrov Hristov";
echo "<br>clearText = ".$clearText.", cryptoText = ".cryptoText($clearText);
$clearText = "[email protected]";
echo "<br>clearText = ".$clearText.", cryptoText = ".cryptoText($clearText);
$clearText = "[email protected]";
echo "<br>clearText = ".$clearText.", cryptoText = ".cryptoText($clearText);
echo "<br><br>Тестване на ДЕкриптиране на текст :";
$cryptoText = "nfrfpipAen_jj/apk";
echo "<br><br>cryptoText = ".$cryptoText.", deCryptoText=".deCryptoText($cryptoText);
$cryptoText = "?mcyQcuppt!Fsgtrpt";
echo "<br>cryptoText = ".$cryptoText.", deCryptoText=".deCryptoText($cryptoText);
$cryptoText = "njqnmw`vrjjl_A_cmsghco,ce";
echo "<br>cryptoText = ".$cryptoText.", deCryptoText=".deCryptoText($cryptoText);
?>