Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
.
namespace core;
/**
* Unit tests for the xhprof class.
*
* @package core
* @category test
* @copyright 2019 Brendan Heywood
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class xhprof_test extends \advanced_testcase {
/**
* Data provider for string matches
*
* @return array
*/
public function profiling_string_matches_provider() {
return [
['/index.php', '/index.php', true],
['/some/dir/index.php', '/index.php', false],
['/course/view.php', '/course/view.php', true],
['/view.php', '/course/view.php', false],
['/mod/forum', '/mod/forum/*', false],
['/mod/forum/', '/mod/forum/*', true],
['/mod/forum/index.php', '/mod/forum/*', true],
['/mod/forum/foo.php', '/mod/forum/*', true],
['/mod/forum/view.php', '/mod/*/view.php', true],
['/mod/one/two/view.php', '/mod/*/view.php', true],
['/view.php', '*/view.php', true],
['/mod/one/two/view.php', '*/view.php', true],
['/foo.php', '/foo.php,/bar.php', true],
['/bar.php', '/foo.php,/bar.php', true],
['/foo/bar.php', "/foo.php,/bar.php", false],
['/foo/bar.php', "/foo.php,*/bar.php", true],
['/foo/bar.php', "/foo*.php,/bar.php", true],
['/foo.php', "/foo.php\n/bar.php", true],
['/bar.php', "/foo.php\n/bar.php", true],
['/foo/bar.php', "/foo.php\n/bar.php", false],
['/foo/bar.php', "/foo.php\n*/bar.php", true],
['/foo/bar.php', "/foo*.php\n/bar.php", true],
];
}
/**
* Test the matching syntax
*
* @dataProvider profiling_string_matches_provider
* @param string $string
* @param string $patterns
* @param bool $expected
*/
public function test_profiling_string_matches($string, $patterns, $expected) {
global $CFG;
require_once($CFG->libdir . '/xhprof/xhprof_moodle.php');
$result = profiling_string_matches($string, $patterns);
$this->assertSame($result, $expected);
}
}