From ca167d5da266c23193d46f238cb97be99d8fb618 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 21 Sep 2010 23:25:08 -0400 Subject: [PATCH] Changing schema test to not alter the table and break other tests. --- cake/tests/cases/console/libs/schema.test.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cake/tests/cases/console/libs/schema.test.php b/cake/tests/cases/console/libs/schema.test.php index b3ff9150a..22c83062e 100644 --- a/cake/tests/cases/console/libs/schema.test.php +++ b/cake/tests/cases/console/libs/schema.test.php @@ -424,6 +424,12 @@ class SchemaShellTest extends CakeTestCase { * @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 @@ -431,12 +437,10 @@ class SchemaShellTest extends CakeTestCase { $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'])); - } /**