cakephp2-php8/cake/tests/cases/libs/cake_test_case.test.php

142 lines
3.5 KiB
PHP
Raw Normal View History

<?php
/**
* CakeTestCaseTest file
*
* Test Case for CakeTestCase class
*
* PHP versions 4 and 5
*
2009-11-06 06:46:59 +00:00
* CakePHP : Rapid Development Framework (http://cakephp.org)
2010-01-14 04:47:14 +00:00
* Copyright 2006-2010, Cake Software Foundation, Inc.
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
2010-01-14 04:47:14 +00:00
* @copyright Copyright 2006-2010, Cake Software Foundation, Inc.
2009-11-06 06:00:11 +00:00
* @link http://cakephp.org CakePHP Project
* @package cake
* @subpackage cake.cake.libs.
* @since CakePHP v 1.2.0.4487
2009-11-06 06:51:51 +00:00
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
if (!class_exists('AppController')) {
require_once LIBS . 'controller' . DS . 'app_controller.php';
} elseif (!defined('APP_CONTROLLER_EXISTS')) {
define('APP_CONTROLLER_EXISTS', true);
}
/**
* CakeTestCaseTest
*
* @package cake
* @subpackage cake.tests.cases.libs
*/
class CakeTestCaseTest extends CakeTestCase {
public static function setUpBeforeClass() {
require_once TEST_CAKE_CORE_INCLUDE_PATH . DS . 'tests' . DS . 'fixtures' . DS . 'assert_tags_test_case.php';
require_once TEST_CAKE_CORE_INCLUDE_PATH . DS . 'tests' . DS . 'fixtures' . DS . 'fixturized_test_case.php';
}
/**
* setUp
*
* @access public
* @return void
*/
function setUp() {
$this->_debug = Configure::read('debug');
$this->Reporter = $this->getMock('CakeHtmlReporter');
}
/**
* tearDown
*
* @access public
* @return void
*/
function tearDown() {
Configure::write('debug', $this->_debug);
unset($this->Case);
unset($this->Result);
unset($this->Reporter);
}
/**
* testAssertGoodTags
*
* @access public
* @return void
*/
function testAssertTagsQuotes() {
$test = new AssertTagsTestCase('testAssertTagsQuotes');
$result = $test->run();
$this->assertEquals(0, $result->errorCount());
$this->assertTrue($result->wasSuccessful());
$this->assertEquals(0, $result->failureCount());
}
/**
* testNumericValuesInExpectationForAssertTags
*
* @access public
* @return void
*/
function testNumericValuesInExpectationForAssertTags() {
$test = new AssertTagsTestCase('testNumericValuesInExpectationForAssertTags');
$result = $test->run();
$this->assertEquals(0, $result->errorCount());
$this->assertTrue($result->wasSuccessful());
$this->assertEquals(0, $result->failureCount());
}
2009-12-02 16:37:43 +00:00
/**
* testBadAssertTags
*
* @access public
* @return void
*/
function testBadAssertTags() {
$test = new AssertTagsTestCase('testBadAssertTags');
$result = $test->run();
$this->assertEquals(0, $result->errorCount());
$this->assertFalse($result->wasSuccessful());
$this->assertEquals(1, $result->failureCount());
$test = new AssertTagsTestCase('testBadAssertTags2');
$result = $test->run();
$this->assertEquals(0, $result->errorCount());
$this->assertFalse($result->wasSuccessful());
$this->assertEquals(1, $result->failureCount());
}
/**
* testLoadFixtures
*
* @access public
* @return void
*/
function testLoadFixtures() {
$test = new FixturizedTestCase('testFixturePresent');
$result = $test->run();
//$this->Case->fixtures = array('core.post');
//$this->Case->autoFixtures = false;
//$this->Case->before('start');
//$this->expectError();
//$this->Case->loadFixtures('Wrong!');
//$this->Case->end();
}
/**
* testSkipIf
*
* @return void
*/
function testSkipIf() {
//$this->Case = new SubjectCakeTestCase;
//$this->assertTrue($this->Case->skipIf(true));
//$this->assertFalse($this->Case->skipIf(false));
}
}
?>