Skip to content

Commit

Permalink
Adding tests for view()
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Aug 8, 2009
1 parent 3c46b51 commit 12b9475
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion cake/tests/cases/console/libs/schema.test.php
Expand Up @@ -41,7 +41,7 @@
);
Mock::generatePartial(
'SchemaShell', 'MockSchemaShell',
array('in', 'out', 'hr', 'createFile', 'error', 'err')
array('in', 'out', 'hr', 'createFile', 'error', 'err', '_stop')
);

/**
Expand All @@ -52,6 +52,7 @@
*/
class SchemaShellTest extends CakeTestCase {

var $fixtures = array('core.article', 'core.user');
/**
* startTest method
*
Expand Down Expand Up @@ -108,5 +109,29 @@ function testStartup() {
$this->assertEqual($this->Task->Schema->connection, 'test_suite');
$this->assertEqual($this->Task->Schema->path, '/test/path');
}

/**
* Test View - and that it dumps the schema file to stdout
*
* @return void
**/
function testView() {
$this->Task->startup();
$this->Task->Schema->path = APP . 'config' . DS . 'schema';
$this->Task->params['file'] = 'i18n.php';
$this->Task->expectOnce('_stop');
$this->Task->expectOnce('out');
$this->Task->expectAt(0, 'out', array(new PatternExpectation('/class i18nSchema extends CakeSchema/')));
$this->Task->view();
}

/**
* undocumented function
*
* @return void
**/
function () {

}
}
?>

0 comments on commit 12b9475

Please sign in to comment.