This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * Test - client function |
||
4 | * @package fwolflib |
||
5 | * @subpackage func.test |
||
6 | * @copyright Copyright 2012, Fwolf |
||
7 | * @author Fwolf <[email protected]> |
||
8 | * @since 2012-12-06 |
||
9 | */ |
||
10 | |||
11 | // Define like this, so test can run both under eclipse and web alone. |
||
12 | // {{{ |
||
13 | if (! defined('SIMPLE_TEST')) { |
||
14 | define('SIMPLE_TEST', 'simpletest/'); |
||
15 | require_once(SIMPLE_TEST . 'autorun.php'); |
||
16 | } |
||
17 | // Then set output encoding |
||
18 | //header('Content-Type: text/html; charset=utf-8'); |
||
19 | // }}} |
||
20 | |||
21 | // Require library define file which need test |
||
22 | require_once(dirname(__FILE__) . '/datetime.php'); |
||
23 | require_once(dirname(__FILE__) . '/ecl.php'); |
||
24 | require_once(dirname(__FILE__) . '/request.php'); |
||
25 | |||
26 | class TestFuncDatetime extends UnitTestCase { |
||
27 | |||
28 | function TestSecToStr () { |
||
0 ignored issues
–
show
|
|||
29 | $this->assertEqual(SecToStr(12), '12s'); |
||
0 ignored issues
–
show
The function
SecToStr() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtSecToStr()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
30 | $this->assertEqual(SecToStr(120), '2i'); |
||
0 ignored issues
–
show
The function
SecToStr() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtSecToStr()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
31 | |||
32 | $i = 65831316; |
||
33 | $this->assertEqual(StrToSec(SecToStr($i, false)), $i); |
||
0 ignored issues
–
show
The function
SecToStr() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtSecToStr()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() The function
StrToSec() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
34 | |||
35 | $i = 65831316985649; |
||
36 | $this->assertEqual(StrToSec(SecToStr($i, false)), $i); |
||
0 ignored issues
–
show
The function
SecToStr() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtSecToStr()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() The function
StrToSec() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
37 | } // end of func TestSecToStr |
||
38 | |||
39 | |||
40 | function TestStrToSec () { |
||
0 ignored issues
–
show
|
|||
41 | $this->assertEqual(StrToSec(''), 0); |
||
0 ignored issues
–
show
The function
StrToSec() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
42 | $this->assertEqual(StrToSec(100), 100); |
||
0 ignored issues
–
show
The function
StrToSec() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
43 | $this->assertEqual(StrToSec('100'), 100); |
||
0 ignored issues
–
show
The function
StrToSec() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
44 | |||
45 | $this->assertEqual(StrToSec('3s'), 3); |
||
0 ignored issues
–
show
The function
StrToSec() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
46 | $this->assertEqual(StrToSec('2i 3s'), 123); |
||
0 ignored issues
–
show
The function
StrToSec() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
47 | $this->assertEqual(StrToSec('2I- 3s'), 117); |
||
0 ignored issues
–
show
The function
StrToSec() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
48 | $this->assertEqual(StrToSec('3I - 1i 3s'), 123); |
||
0 ignored issues
–
show
The function
StrToSec() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
49 | $this->assertEqual(StrToSec('2H- 118i -3s'), 117); |
||
0 ignored issues
–
show
The function
StrToSec() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
50 | $this->assertEqual(StrToSec('-118i2H-3s'), 117); |
||
0 ignored issues
–
show
The function
StrToSec() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
51 | |||
52 | $this->assertEqual(StrToSec('2centuries - 199Year-364DAY+ 4month |
||
0 ignored issues
–
show
The function
StrToSec() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
53 | -17w+2d-3d-24h1h-1hour+1h-58i2min-2minutes3s'), 123); |
||
54 | $this->assertEqual(StrToSec('3s-2i2i-58i1h-1h1h-24h-3d2d |
||
0 ignored issues
–
show
The function
StrToSec() has been deprecated with message: Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
55 | -17w4m-364d-199y2c'), 123); |
||
56 | } // end of func TestStrToSec |
||
57 | |||
58 | } // end of class TestFuncDatetime |
||
59 | |||
60 | |||
61 | // Change output charset in this way. |
||
62 | // {{{ |
||
63 | $s_url = GetSelfUrl(false); |
||
0 ignored issues
–
show
The function
GetSelfUrl() has been deprecated with message: Use Fwlib\Util\HttpUtil::getSelfUrl()
This function has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead. ![]() |
|||
64 | $s_url = substr($s_url, strrpos($s_url, '/') + 1); |
||
65 | if ('datetime.test.php' == $s_url) { |
||
66 | $test = new TestFuncDatetime(); |
||
67 | $test->run(new HtmlReporter('utf-8')); |
||
68 | } |
||
69 | // }}} |
||
70 | ?> |
||
0 ignored issues
–
show
It is not recommended to use PHP's closing tag
?> in files other than templates.
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore. A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever. ![]() |
|||
71 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.