Skip to content

Commit

Permalink
Add type hints in SchemaShell.
Browse files Browse the repository at this point in the history
I'm trying to figure out what's going on in the failing travis builds.
  • Loading branch information
markstory committed Mar 1, 2013
1 parent 8d3cd6e commit 1d529c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Console/Command/SchemaShell.php
Expand Up @@ -305,7 +305,7 @@ protected function _loadSchema() {
* @param string $table
* @return void
*/
protected function _create($Schema, $table = null) {
protected function _create(CakeSchema $Schema, $table = null) {
$db = ConnectionManager::getDataSource($this->Schema->connection);

$drop = $create = array();
Expand Down Expand Up @@ -395,7 +395,7 @@ protected function _update(&$Schema, $table = null) {
* @param CakeSchema $Schema
* @return void
*/
protected function _run($contents, $event, &$Schema) {
protected function _run($contents, $event, CakeSchema $Schema) {
if (empty($contents)) {
$this->err(__d('cake_console', 'Sql could not be run'));
return;
Expand Down
7 changes: 5 additions & 2 deletions lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
Expand Up @@ -471,8 +471,11 @@ public function testUpdateWithTable() {
);
$this->Shell->args = array('SchemaShellTest', 'articles');
$this->Shell->startup();
$this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
$this->Shell->expects($this->once())->method('_run')
$this->Shell->expects($this->any())
->method('in')
->will($this->returnValue('y'));
$this->Shell->expects($this->once())
->method('_run')
->with($this->arrayHasKey('articles'), 'update', $this->isInstanceOf('CakeSchema'));

$this->Shell->update();
Expand Down

0 comments on commit 1d529c1

Please sign in to comment.