Skip to content

Commit

Permalink
Making more tests work in phpunit.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed May 30, 2010
1 parent 0dc6271 commit 62ec258
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions cake/tests/cases/console/libs/tasks/controller.test.php
Expand Up @@ -248,16 +248,16 @@ function testDoComponentsTrailingCommas() {
*
* @return void
*/
public function xxtestConfirmController() {
public function testConfirmController() {
$controller = 'Posts';
$scaffold = false;
$helpers = array('Ajax', 'Time');
$components = array('Acl', 'Auth');
$uses = array('Comment', 'User');

$this->Task->expects($this->at(2))->method('out')->with("Controller Name:\n\t$controller");
$this->Task->expects($this->at(3))->method('out')->with("Helpers:\n\tAjax, Time");
$this->Task->expects($this->at(4))->method('out')->with("Components:\n\tAcl, Auth");
$this->Task->expects($this->at(4))->method('out')->with("Controller Name:\n\t$controller");
$this->Task->expects($this->at(5))->method('out')->with("Helpers:\n\tAjax, Time");
$this->Task->expects($this->at(6))->method('out')->with("Components:\n\tAcl, Auth");
$this->Task->confirmController($controller, $scaffold, $helpers, $components);
}

Expand All @@ -266,7 +266,7 @@ public function xxtestConfirmController() {
*
* @return void
*/
public function xxtestBake() {
public function testBake() {
$helpers = array('Ajax', 'Time');
$components = array('Acl', 'Auth');
$this->Task->expects($this->any())->method('createFile')->will($this->returnValue(true));
Expand Down Expand Up @@ -295,17 +295,20 @@ public function xxtestBake() {
*
* @return void
*/
public function xxtestBakeWithPlugin() {
public function testBakeWithPlugin() {
$this->Task->plugin = 'ControllerTest';
$helpers = array('Ajax', 'Time');
$components = array('Acl', 'Auth');
$uses = array('Comment', 'User');

$path = APP . 'plugins' . DS . 'controller_test' . DS . 'controllers' . DS . 'articles_controller.php';

$this->Task->expects($this->at(0))->method('createFile')->with($path, '*');
$this->Task->expects($this->at(0))->method('createFile')->with(
$path,
new PHPUnit_Framework_Constraint_IsAnything()
);
$this->Task->expects($this->at(1))->method('createFile')->with(
$path,
$path,
new PHPUnit_Framework_Constraint_PCREMatch('/ArticlesController extends ControllerTestAppController/')
);

Expand Down

0 comments on commit 62ec258

Please sign in to comment.