Browse Source

Wire component bake into BakeShell.

Fix merge conflict mistakes.
mark_story 12 years ago
parent
commit
f381f8787c

+ 14 - 2
src/Console/Command/BakeShell.php

@@ -40,7 +40,13 @@ class BakeShell extends Shell {
  *
  * @var array
  */
-	public $tasks = ['Behavior', 'Project', 'Model', 'Controller', 'View', 'Helper', 'Plugin', 'Fixture', 'Test'];
+	public $tasks = [
+		'Plugin', 'Project',
+		'Model', 'Behavior',
+		'Controller', 'Component',
+		'View', 'Helper',
+		'Fixture', 'Test'
+	];
 
 /**
  * The connection being used.
@@ -85,10 +91,13 @@ class BakeShell extends Shell {
 		$this->out(__d('cake_console', 'The following commands you can generate skeleton code your your application.'));
 		$this->out(__d('cake_console', 'Available bake commands:'));
 		$this->out('');
-		$this->out(__d('cake_console', 'behavior'));
 		$this->out(__d('cake_console', 'model'));
+		$this->out(__d('cake_console', 'behavior'));
 		$this->out(__d('cake_console', 'view'));
 		$this->out(__d('cake_console', 'controller'));
+		$this->out(__d('cake_console', 'component'));
+		$this->out(__d('cake_console', 'project'));
+		$this->out(__d('cake_console', 'plugin'));
 		$this->out(__d('cake_console', 'fixture'));
 		$this->out(__d('cake_console', 'project'));
 		$this->out(__d('cake_console', 'test'));
@@ -170,6 +179,9 @@ class BakeShell extends Shell {
 		])->addSubcommand('controller', [
 			'help' => __d('cake_console', 'Bake a controller.'),
 			'parser' => $this->Controller->getOptionParser()
+		])->addSubcommand('component', [
+			'help' => __d('cake_console', 'Bake a component.'),
+			'parser' => $this->Controller->getOptionParser()
 		])->addSubcommand('fixture', [
 			'help' => __d('cake_console', 'Bake a fixture.'),
 			'parser' => $this->Fixture->getOptionParser()

+ 1 - 1
tests/TestCase/Console/Command/BakeShellTest.php

@@ -107,7 +107,7 @@ class BakeShellTest extends TestCase {
 			->with($this->stringContains('The following commands'));
 		$this->Shell->expects($this->at(3))
 			->method('out')
-			->with('behavior');
+			->with('model');
 		$this->Shell->main();
 	}
 

+ 2 - 2
tests/TestCase/Console/Command/CompletionShellTest.php

@@ -164,7 +164,7 @@ class CompletionShellTest extends TestCase {
 		$this->Shell->runCommand('subCommands', array('subCommands', 'CORE.bake'));
 		$output = $this->Shell->stdout->output;
 
-		$expected = "behavior controller fixture helper model plugin project test view\n";
+		$expected = "behavior component controller fixture helper model plugin project test view\n";
 		$this->assertEquals($expected, $output);
 	}
 
@@ -229,7 +229,7 @@ class CompletionShellTest extends TestCase {
 		$this->Shell->runCommand('subCommands', array('subCommands', 'bake'));
 		$output = $this->Shell->stdout->output;
 
-		$expected = "behavior controller fixture helper model plugin project test view\n";
+		$expected = "behavior component controller fixture helper model plugin project test view\n";
 		$this->assertEquals($expected, $output);
 	}
 

+ 1 - 10
tests/TestCase/Console/Command/Task/FixtureTaskTest.php

@@ -71,17 +71,8 @@ class FixtureTaskTest extends TestCase {
  *
  * @return void
  */
-<<<<<<< HEAD
-	public function testConstruct() {
-		$out = $this->getMock('Cake\Console\ConsoleOutput', array(), array(), '', false);
-		$in = $this->getMock('Cake\Console\ConsoleInput', array(), array(), '', false);
-
-		$Task = new FixtureTask($out, $out, $in);
-		$this->assertEquals(ROOT . DS . 'Test' . DS . 'Fixture' . DS, $Task->path);
-=======
 	public function testGetPath() {
-		$this->assertEquals(ROOT . '/Test/Fixture/', $this->Task->getPath());
->>>>>>> Update other bake tasks to use newer style path generation.
+		$this->assertPathEquals(ROOT . '/Test/Fixture/', $this->Task->getPath());
 	}
 
 /**

+ 1 - 1
tests/TestCase/Console/Command/Task/ModelTaskTest.php

@@ -754,7 +754,7 @@ class ModelTaskTest extends TestCase {
 			->method('createFile')
 			->with($tableFile, $this->stringContains('class BakeArticlesTable extends Table'));
 
-		$entityFile = $this->_normalizePath(APP 'Model/Entity/BakeArticle.php');
+		$entityFile = $this->_normalizePath(APP . 'Model/Entity/BakeArticle.php');
 		$this->Task->expects($this->at(1))
 			->method('createFile')
 			->with($entityFile, $this->stringContains('class BakeArticle extends Entity'));