Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding tests for view()

  • Loading branch information...
commit 12b94756d02a474e3d5417572dafa14a4497fd74 1 parent 3c46b51
@markstory markstory authored
Showing with 26 additions and 1 deletion.
  1. +26 −1 cake/tests/cases/console/libs/schema.test.php
View
27 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 () {
+
+ }
}
?>
Please sign in to comment.
Something went wrong with that request. Please try again.