Skip to content

Commit

Permalink
Updating component tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed May 13, 2011
1 parent 53037d9 commit 18b5b36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Expand Up @@ -157,7 +157,7 @@ function testPluginModel() {
App::build(array(
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
), true);
App::objects('plugin', null, false);
CakePlugin::load('TestPlugin');

$PluginModel = ClassRegistry::init('TestPlugin.TestPluginAuthUser');
$user['id'] = 1;
Expand All @@ -182,6 +182,7 @@ function testPluginModel() {
'updated' => date('Y-m-d H:i:s')
);
$this->assertEquals($expected, $result);
CakePlugin::unload();
}

}
4 changes: 4 additions & 0 deletions lib/Cake/tests/Case/Controller/ComponentCollectionTest.php
Expand Up @@ -85,13 +85,15 @@ function testLoadWithAlias() {
$this->assertInstanceOf('CookieAliasComponent', $result);

App::build(array('plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)));
CakePlugin::load('TestPlugin');
$result = $this->Components->load('SomeOther', array('className' => 'TestPlugin.OtherComponent'));
$this->assertInstanceOf('OtherComponentComponent', $result);
$this->assertInstanceOf('OtherComponentComponent', $this->Components->SomeOther);

$result = $this->Components->attached();
$this->assertEquals(array('Cookie', 'SomeOther'), $result, 'attached() results are wrong.');
App::build();
CakePlugin::unload();
}

/**
Expand Down Expand Up @@ -125,10 +127,12 @@ function testLoadPluginComponent() {
App::build(array(
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
));
CakePlugin::load('TestPlugin');
$result = $this->Components->load('TestPlugin.OtherComponent');
$this->assertInstanceOf('OtherComponentComponent', $result, 'Component class is wrong.');
$this->assertInstanceOf('OtherComponentComponent', $this->Components->OtherComponent, 'Class is wrong');
App::build();
CakePlugin::unload();
}

/**
Expand Down

0 comments on commit 18b5b36

Please sign in to comment.