<commit_before><?php

define('__DEBUG__', 1);
define('_XE_PATH_', realpath(dirname(__FILE__).'/../../../'));
require _XE_PATH_.'/classes/file/FileHandler.class.php';
require _XE_PATH_.'/classes/template/TemplateHandler.class.php';

$_SERVER['SCRIPT_NAME'] = '/xe/index.php';

class TemplateHandlerTest extends PHPUnit_Framework_TestCase
{
	var $prefix = '<?php if(!defined("__XE__"))exit;?>';

	static public function provider()
	{
		return array(
			// pipe cond
			array(
				'<a href="#" class="active"|cond="$cond > 10">Link</a>',
				'<a href="#"<?php if($__Context->cond > 10){ ?> class="active"<?php } ?>>Link</a>'
			),
			// cond
			array(
				'<a href="#">Link1</a><a href="#cond"><span cond="$cond">say, hello</span></a>',
				'<a href="#">Link1</a><a href="#cond"><?php if($__Context->cond){ ?><span>say, hello</span><?php } ?></a>'<commit_msg>Correct _XE_PATH_ in the template test file<commit_after><?php

define('__DEBUG__', 1);
define('_XE_PATH_', str_replace('tests/classes/template/TemplateHandlerTest.class.php', '', strtr(__FILE__, '\\', '/')));
require _XE_PATH_.'/classes/file/FileHandler.class.php';
require _XE_PATH_.'/classes/template/TemplateHandler.class.php';

$_SERVER['SCRIPT_NAME'] = '/xe/index.php';

class TemplateHandlerTest extends PHPUnit_Framework_TestCase
{
	var $prefix = '<?php if(!defined("__XE__"))exit;?>';

	static public function provider()
	{
		return array(
			// pipe cond
			array(
				'<a href="#" class="active"|cond="$cond > 10">Link</a>',
				'<a href="#"<?php if($__Context->cond > 10){ ?> class="active"<?php } ?>>Link</a>'
			),
			// cond
			array(
				'<a href="#">Link1</a><a href="#cond"><span cond="$cond">say, hello</span></a>',
				'<a href="#">Link1</a><a href="#cond"><?php if($__Context->cond){ ?><span>say, hello</span><?php } ?></a>'
{'fraction_non_alphanumeric': 0.24486396446418657, 'fraction_numerical': 0.007773459189339256, 'mean_word_length': 5.129251700680272, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6124228', 'n_tokens_mistral': 698, 'n_tokens_neox': 637, 'n_words': 110}