Skip to content

Commit

Permalink
Changing schema test to not alter the table and break other tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 25, 2010
1 parent 5c94bdd commit ca167d5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cake/tests/cases/console/libs/schema.test.php
Expand Up @@ -424,19 +424,23 @@ public function testCreateWithTableArgs() {
* @return void
*/
public function testUpdateWithTable() {
$this->Shell = $this->getMock(
'SchemaShell',
array('in', 'out', 'hr', 'createFile', 'error', 'err', '_stop', '__run'),
array(&$this->Dispatcher)
);

$this->Shell->params = array(
'connection' => 'test',
'f' => true
);
$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')
->with($this->arrayHasKey('articles'), 'update', $this->isInstanceOf('CakeSchema'));

$this->Shell->update();

$article =& new Model(array('name' => 'Article', 'ds' => 'test'));
$fields = $article->schema();
$this->assertTrue(isset($fields['summary']));

}

/**
Expand Down

0 comments on commit ca167d5

Please sign in to comment.