public function testTestModel() {
$this->request->params += array(
'command' => 'create', 'action' => 'test',
'args' => array('model', 'Posts')
);
$test = new Test(array(
'request' => $this->request, 'classes' => $this->classes
));
$test->path = $this->_testPath;
$test->run('test');
$expected = "PostsTest created in create_test\\tests\\cases\\models.\n";
$result = $test->response->output;
$this->assertEqual($expected, $result);
$expected = <<<'test'
namespace create_test\tests\cases\models;
use create_test\models\Posts;
class PostsTest extends \lithium\test\Unit {
public function setUp() {}
public function tearDown() {}
}
test;
$replace = array("<?php", "?>");
$result = str_replace($replace, '',
file_get_contents($this->_testPath . '/create_test/tests/cases/models/PostsTest.php')
);
$this->assertEqual($expected, $result);
}