[1] | 1 | <?php |
---|
| 2 | /** |
---|
[362] | 3 | * The Strangecode Codebase - a general application development framework for PHP |
---|
| 4 | * For details visit the project site: <http://trac.strangecode.com/codebase/> |
---|
[396] | 5 | * Copyright 2001-2012 Strangecode, LLC |
---|
[362] | 6 | * |
---|
| 7 | * This file is part of The Strangecode Codebase. |
---|
[42] | 8 | * |
---|
[362] | 9 | * The Strangecode Codebase is free software: you can redistribute it and/or |
---|
| 10 | * modify it under the terms of the GNU General Public License as published by the |
---|
| 11 | * Free Software Foundation, either version 3 of the License, or (at your option) |
---|
| 12 | * any later version. |
---|
| 13 | * |
---|
| 14 | * The Strangecode Codebase is distributed in the hope that it will be useful, but |
---|
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
| 16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
---|
| 17 | * details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License along with |
---|
| 20 | * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. |
---|
| 21 | */ |
---|
| 22 | |
---|
| 23 | /** |
---|
| 24 | * PHPUnit test case for codebase/lib/CSS.inc.php |
---|
| 25 | * |
---|
[42] | 26 | * The method skeletons below need to be filled in with |
---|
| 27 | * real data so that the tests will run correctly. Replace |
---|
| 28 | * all EXPECTED_VAL and PARAM strings with real data. |
---|
| 29 | * |
---|
[1] | 30 | * Created with PHPUnit_Skeleton on 2005-08-09 |
---|
| 31 | */ |
---|
| 32 | |
---|
[468] | 33 | class CSSTest extends PHPUnit_Framework_TestCase { |
---|
| 34 | |
---|
[1] | 35 | var $CSS; |
---|
| 36 | var $test_css_file; |
---|
| 37 | |
---|
| 38 | function setUp() |
---|
| 39 | { |
---|
| 40 | require dirname(__FILE__) . '/_config.inc.php'; |
---|
| 41 | $this->test_css_file = dirname(__FILE__) . '/../css/codebase.inc.css'; |
---|
| 42 | require_once '../lib/CSS.inc.php'; |
---|
[468] | 43 | $this->CSS = new CSS(); |
---|
[1] | 44 | $this->CSS->setFile($this->test_css_file); |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | function tearDown() |
---|
| 48 | { |
---|
| 49 | unset($this->CSS); |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | function test_setparam() |
---|
| 53 | { |
---|
| 54 | $this->CSS->setparam(array('asdf' => 123)); |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | function test_getparam() |
---|
| 58 | { |
---|
| 59 | $this->CSS->getparam('asdf'); |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | function test_setfile() |
---|
| 63 | { |
---|
| 64 | $this->CSS->setfile(dirname(__FILE__) . '/../css/codebase.inc.css'); |
---|
| 65 | } |
---|
| 66 | |
---|
| 67 | function test_headers() |
---|
| 68 | { |
---|
| 69 | ob_start(); |
---|
| 70 | $this->CSS->headers(); |
---|
| 71 | $result = ob_get_clean(); |
---|
| 72 | } |
---|
| 73 | |
---|
| 74 | function test_output() |
---|
| 75 | { |
---|
| 76 | ob_start(); |
---|
| 77 | $this->CSS->output(); |
---|
| 78 | $result = ob_get_clean(); |
---|
| 79 | $this->assertEquals(file_get_contents($this->test_css_file), $result); |
---|
| 80 | } |
---|
| 81 | |
---|
| 82 | } |
---|