ZF-8222: format class name for class checks
[zend.git] / tests / Zend / Cache / OutputFrontendTest.php
blobaaf67b1f27d960045ff89c91b13e890edb4890e4
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
15 * @category Zend
16 * @package Zend_Cache
17 * @subpackage UnitTests
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id$
23 /**
24 * Zend_Cache
26 require_once 'Zend/Cache.php';
27 require_once 'Zend/Cache/Frontend/Output.php';
28 require_once 'Zend/Cache/Backend/Test.php';
30 /**
31 * PHPUnit test case
33 require_once 'PHPUnit/Framework/TestCase.php';
35 /**
36 * @category Zend
37 * @package Zend_Cache
38 * @subpackage UnitTests
39 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
40 * @license http://framework.zend.com/license/new-bsd New BSD License
41 * @group Zend_Cache
43 class Zend_Cache_OutputFrontendTest extends PHPUnit_Framework_TestCase {
45 private $_instance;
47 public function setUp()
49 if (!$this->_instance) {
50 $this->_instance = new Zend_Cache_Frontend_Output(array());
51 $this->_backend = new Zend_Cache_Backend_Test();
52 $this->_instance->setBackend($this->_backend);
56 public function tearDown()
58 unset($this->_instance);
61 public function testConstructorCorrectCall()
63 $test = new Zend_Cache_Frontend_Output(array('lifetime' => 3600, 'caching' => true));
66 public function testStartEndCorrectCall1()
68 ob_start();
69 ob_implicit_flush(false);
70 if (!($this->_instance->start('123'))) {
71 echo('foobar');
72 $this->_instance->end();
74 $data = ob_get_contents();
75 ob_end_clean();
76 ob_implicit_flush(true);
77 $this->assertEquals('foo', $data);
80 public function testStartEndCorrectCall2()
82 ob_start();
83 ob_implicit_flush(false);
84 if (!($this->_instance->start('false'))) {
85 echo('foobar');
86 $this->_instance->end();
88 $data = ob_get_contents();
89 ob_end_clean();
90 ob_implicit_flush(true);
91 $this->assertEquals('foobar', $data);