Add test for serendipity_getTemplateFile
This commit is contained in:
parent
6419df26e0
commit
d31c8960f8
18
tests/README
18
tests/README
@ -1,3 +1,21 @@
|
|||||||
|
PHPUnit
|
||||||
|
=======
|
||||||
|
|
||||||
|
1. In tests/, download PHPUnit
|
||||||
|
|
||||||
|
$ wget https://phar.phpunit.de/phpunit.phar
|
||||||
|
|
||||||
|
|
||||||
|
Running the Tests
|
||||||
|
=================
|
||||||
|
|
||||||
|
|
||||||
|
$ php phpunit.phar --configuration config.xml.dist --coverage-html report include/*
|
||||||
|
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
PHPUnit and Selenium RC
|
PHPUnit and Selenium RC
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
|
33
tests/include/functionsConfigTest.php
Normal file
33
tests/include/functionsConfigTest.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$serendipity['dbType'] = 'pdo-sqlite';
|
||||||
|
define('IN_serendipity', true);
|
||||||
|
require_once dirname(__FILE__) . '/../../include/functions_config.inc.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class functionsTest
|
||||||
|
*/
|
||||||
|
class functionsConfigTest extends PHPUnit_Framework_TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function test_serendipity_getTemplateFile()
|
||||||
|
{
|
||||||
|
global $serendipity;
|
||||||
|
$serendipity['template'] = 'next';
|
||||||
|
$serendipity['template_engine'] = '2k11';
|
||||||
|
$serendipity['defaultTemplate'] = '2k11';
|
||||||
|
$serendipity['templatePath'] = '/templates/';
|
||||||
|
$serendipity['template_backend'] = '2k11';
|
||||||
|
$serendipity['serendipityPath'] = realpath('../');
|
||||||
|
$serendipity['serendipityHTTPPath'] = realpath('/');
|
||||||
|
|
||||||
|
$this->assertContains('next/index.tpl', serendipity_getTemplateFile('index.tpl'));
|
||||||
|
define('IN_serendipity_admin', true);
|
||||||
|
$this->assertContains('2k11/admin/index.tpl', serendipity_getTemplateFile('admin/index.tpl'));
|
||||||
|
$this->assertContains('next/index.tpl', serendipity_getTemplateFile('index.tpl', 'serendipityHTTPPath', true));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$serendipity['dbType'] = 'pdo-sqlite';
|
$serendipity['dbType'] = 'pdo-sqlite';
|
||||||
|
define('IN_serendipity', true);
|
||||||
require_once dirname(__FILE__) . '/../../include/functions.inc.php';
|
require_once dirname(__FILE__) . '/../../include/functions.inc.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user