* Copyright 2001-2010 Strangecode, LLC * * This file is part of The Strangecode Codebase. * * The Strangecode Codebase is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your option) * any later version. * * The Strangecode Codebase is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * The Strangecode Codebase. If not, see . */ /** * PHPUnit test case for codebase/lib/CSS.inc.php * * The method skeletons below need to be filled in with * real data so that the tests will run correctly. Replace * all EXPECTED_VAL and PARAM strings with real data. * * Created with PHPUnit_Skeleton on 2005-08-09 */ require_once 'PHPUnit.php'; class CSSTest extends PHPUnit_TestCase { var $CSS; var $test_css_file; function CSSTest($name) { $this->PHPUnit_TestCase($name); } function setUp() { require dirname(__FILE__) . '/_config.inc.php'; $this->test_css_file = dirname(__FILE__) . '/../css/codebase.inc.css'; require_once '../lib/CSS.inc.php'; $this->CSS =& new CSS(); $this->CSS->setFile($this->test_css_file); } function tearDown() { unset($this->CSS); } function test_setparam() { $this->CSS->setparam(array('asdf' => 123)); } function test_getparam() { $this->CSS->getparam('asdf'); } function test_setfile() { $this->CSS->setfile(dirname(__FILE__) . '/../css/codebase.inc.css'); } function test_headers() { ob_start(); $this->CSS->headers(); $result = ob_get_clean(); } function test_output() { ob_start(); $this->CSS->output(); $result = ob_get_clean(); $this->assertEquals(file_get_contents($this->test_css_file), $result); } } // Running the test. $suite = new PHPUnit_TestSuite('CSSTest'); $result = PHPUnit::run($suite); echo $result->toString(); ?>