Skip to content
Permalink
Browse files

Using $_mergeParent to unskip tests in test suites.

  • Loading branch information...
markstory committed Dec 16, 2010
1 parent 6206fef commit 339cb41ea27bb99cad8f2bc9ea7c889338c9d0a1
Showing with 22 additions and 32 deletions.
  1. +22 −32 cake/tests/cases/libs/controller/controller_merge_vars.test.php
@@ -21,33 +21,29 @@
*/
App::import('Core', 'Controller');
if (!class_exists('AppController')) {
/**
* Test case AppController
*
* @package cake
* @subpackage cake.tests.cases.libs.controller
*/
class AppController extends Controller {
class MergeVarsAppController extends Controller {
/**
* components
*
* @var array
*/
public $components = array('MergeVar' => array('flag', 'otherFlag', 'redirect' => false));
public $components = array('MergeVar' => array('flag', 'otherFlag', 'redirect' => false));
/**
* helpers
*
* @var array
*/
public $helpers = array('MergeVar' => array('format' => 'html', 'terse'));
}
} elseif (!defined('APP_CONTROLLER_EXISTS')) {
define('APP_CONTROLLER_EXISTS', true);
public $helpers = array('MergeVar' => array('format' => 'html', 'terse'));
}
/**
* MergeVar Component
*
@@ -62,7 +58,7 @@ class MergeVarComponent extends Object {
*
* @package cake.tests.cases.libs.controller
*/
class MergeVariablesController extends AppController {
class MergeVariablesController extends MergeVarsAppController {
/**
* name
@@ -77,14 +73,21 @@ class MergeVariablesController extends AppController {
* @var arrays
*/
public $uses = array();
/**
* parent for mergeVars
*
* @var string
*/
protected $_mergeParent = 'MergeVarsAppController';
}
/**
* MergeVarPlugin App Controller
*
* @package cake.tests.cases.libs.controller
*/
class MergeVarPluginAppController extends AppController {
class MergeVarPluginAppController extends MergeVarsAppController {
/**
* components
@@ -99,6 +102,13 @@ class MergeVarPluginAppController extends AppController {
* @var array
*/
public $helpers = array('Javascript');
/**
* parent for mergeVars
*
* @var string
*/
protected $_mergeParent = 'MergeVarsAppController';
}
/**
@@ -130,23 +140,13 @@ class MergePostsController extends MergeVarPluginAppController {
* @package cake.tests.cases.libs.controller
*/
class ControllerMergeVarsTest extends CakeTestCase {
/**
* end test
*
* @return void
*/
function endTest() {
ClassRegistry::flush();
}
/**
* test that component settings are not duplicated when merging component settings
*
* @return void
*/
function testComponentParamMergingNoDuplication() {
$this->skipIf(defined('APP_CONTROLLER_EXISTS'), "APP_CONTROLLER_EXISTS cannot run {$this->name}");
$Controller = new MergeVariablesController();
$Controller->constructClasses();
@@ -160,8 +160,6 @@ function testComponentParamMergingNoDuplication() {
* @return void
*/
function testComponentMergingWithRedeclarations() {
$this->skipIf(defined('APP_CONTROLLER_EXISTS'), "APP_CONTROLLER_EXISTS cannot run {$this->name}");
$Controller = new MergeVariablesController();
$Controller->components['MergeVar'] = array('remote', 'redirect' => true);
$Controller->constructClasses();
@@ -176,8 +174,6 @@ function testComponentMergingWithRedeclarations() {
* @return void
*/
function testHelperSettingMergingNoDuplication() {
$this->skipIf(defined('APP_CONTROLLER_EXISTS'), "APP_CONTROLLER_EXISTS cannot run {$this->name}");
$Controller = new MergeVariablesController();
$Controller->constructClasses();
@@ -192,9 +188,7 @@ function testHelperSettingMergingNoDuplication() {
* @return void
*/
function testHelperOrderPrecedence() {
$this->skipIf(defined('APP_CONTROLLER_EXISTS'), "APP_CONTROLLER_EXISTS cannot run {$this->name}");
$Controller =& new MergeVariablesController();
$Controller = new MergeVariablesController();
$Controller->helpers = array('Custom', 'Foo' => array('something'));
$Controller->constructClasses();
@@ -212,8 +206,6 @@ function testHelperOrderPrecedence() {
* @return void
*/
function testMergeVarsWithPlugin() {
$this->skipIf(defined('APP_CONTROLLER_EXISTS'), "APP_CONTROLLER_EXISTS cannot run {$this->name}");
$Controller = new MergePostsController();
$Controller->components = array('Email' => array('ports' => 'open'));
$Controller->plugin = 'MergeVarPlugin';
@@ -251,9 +243,7 @@ function testMergeVarsWithPlugin() {
* @return void
*/
function testMergeVarsNotGreedy() {
$this->skipIf(defined('APP_CONTROLLER_EXISTS'), "APP_CONTROLLER_EXISTS cannot run {$this->name}");
$Controller =& new Controller();
$Controller = new Controller();
$Controller->components = array();
$Controller->uses = array();
$Controller->constructClasses();

0 comments on commit 339cb41

Please sign in to comment.
You can’t perform that action at this time.