Skip to content
Permalink
Browse files

Adding tests for view()

  • Loading branch information...
markstory committed Aug 8, 2009
1 parent 3c46b51 commit 12b94756d02a474e3d5417572dafa14a4497fd74
Showing with 26 additions and 1 deletion.
  1. +26 −1 cake/tests/cases/console/libs/schema.test.php
@@ -41,7 +41,7 @@
);
Mock::generatePartial(
'SchemaShell', 'MockSchemaShell',
array('in', 'out', 'hr', 'createFile', 'error', 'err')
array('in', 'out', 'hr', 'createFile', 'error', 'err', '_stop')
);
/**
@@ -52,6 +52,7 @@
*/
class SchemaShellTest extends CakeTestCase {
var $fixtures = array('core.article', 'core.user');
/**
* startTest method
*
@@ -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.
You can’t perform that action at this time.