Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding tests for and fixing the behavior of `cake acl initdb` it now …

…correctly delegates to SchemaShell. Fixes #608
  • Loading branch information...
commit 568e9d3a891c8f033473873769d9f40f59bd36a4 1 parent 81edcdf
@markstory markstory authored
View
2  cake/console/libs/acl.php
@@ -379,7 +379,7 @@ function view() {
* @access public
*/
function initdb() {
- $this->Dispatch->args = array('schema', 'run', 'create', 'DbAcl');
+ $this->Dispatch->args = array('schema', 'create', 'DbAcl');
$this->Dispatch->dispatch();
}
View
14 cake/tests/cases/console/libs/acl.test.php
@@ -36,7 +36,7 @@
Mock::generatePartial(
'ShellDispatcher', 'TestAclShellMockShellDispatcher',
- array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment')
+ array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment', 'dispatch')
);
Mock::generatePartial(
'AclShell', 'MockAclShell',
@@ -331,5 +331,17 @@ function testGetPath() {
$this->Task->expectAt(3, 'out', array(' [4] Elrond'));
$this->Task->getPath();
}
+
+/**
+ * test that initdb makes the correct call.
+ *
+ * @return void
+ */
+ function testInitDb() {
+ $this->Task->Dispatch->expectOnce('dispatch');
+ $this->Task->initdb();
+
+ $this->assertEqual($this->Task->Dispatch->args, array('schema', 'create', 'DbAcl'));
+ }
}
?>
Please sign in to comment.
Something went wrong with that request. Please try again.