Skip to content

Commit

Permalink
Fixing tests in ComponentCollection and HelperCollection as return of…
Browse files Browse the repository at this point in the history
… trigger now depends on the triggered objects.

Removing annoying test that broke anytime something changed in Model.
  • Loading branch information
markstory committed Dec 12, 2010
1 parent bf22af6 commit dc7ff89
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
Expand Up @@ -150,7 +150,7 @@ function testTrigger() {
$this->mockObjects[] = $this->Components->TriggerMockCookie;
$this->mockObjects[] = $this->Components->TriggerMockSecurity;

$this->assertTrue($this->Components->trigger('startup', array(&$controller)));
$this->assertNull($this->Components->trigger('startup', array(&$controller)));
}

/**
Expand All @@ -174,7 +174,7 @@ function testTriggerWithTriggerDisabledObjects() {
$this->mockObjects[] = $this->Components->TriggerMockSecurity;

$result = $this->Components->trigger('initialize', array(&$controller), array('triggerDisabled' => true));
$this->assertTrue($result);
$this->assertNull($result);
}

/**
Expand All @@ -197,7 +197,7 @@ function testTriggerWithDisabledComponents() {

$this->Components->disable('TriggerMockSecurity');

$this->assertTrue($this->Components->trigger('startup', array(&$controller)));
$this->assertNull($this->Components->trigger('startup', array(&$controller)));
}

/**
Expand Down
14 changes: 0 additions & 14 deletions cake/tests/cases/libs/set.test.php
Expand Up @@ -2115,20 +2115,6 @@ function testMapReverse() {
$result = Set::reverse($class);
$this->assertEquals($result, $expected);

$model = new Model(array('id' => false, 'name' => 'Model', 'table' => false));
$expected = array(
'Behaviors' => array('modelName' => 'Model'),
'useDbConfig' => 'default', 'useTable' => false, 'displayField' => null, 'id' => false, 'data' => array(), 'table' => 'models', 'primaryKey' => 'id', 'validate' => array(),
'validationErrors' => array(), 'tablePrefix' => null, 'name' => 'Model', 'alias' => 'Model', 'tableToModel' => array(), 'logTransactions' => false, 'cacheQueries' => false,
'belongsTo' => array(), 'hasOne' => array(), 'hasMany' => array(), 'hasAndBelongsToMany' => array(), 'actsAs' => null, 'whitelist' => array(), 'cacheSources' => true,
'findQueryType' => null, 'recursive' => 1, 'order' => null, 'virtualFields' => array(),
);
$result = Set::reverse($model);

ksort($result);
ksort($expected);
$this->assertEquals($result, $expected);

$class = new stdClass;
$class->User = new stdClass;
$class->User->id = 100;
Expand Down
4 changes: 2 additions & 2 deletions cake/tests/cases/libs/view/helper_collection.test.php
Expand Up @@ -137,7 +137,7 @@ function testTrigger() {

$this->mockObjects[] = $this->Helpers->TriggerMockForm;

$this->assertTrue($this->Helpers->trigger('beforeRender', array('one', 'two')));
$this->assertNull($this->Helpers->trigger('beforeRender', array('one', 'two')));
}

/**
Expand All @@ -163,7 +163,7 @@ function testTriggerWithDisabledHelpers() {

$this->Helpers->disable('TriggerMockForm');

$this->assertTrue($this->Helpers->trigger('beforeRender', array('one', 'two')));
$this->assertNull($this->Helpers->trigger('beforeRender', array('one', 'two')));
}

/**
Expand Down

0 comments on commit dc7ff89

Please sign in to comment.