lithium\tests\cases\console\command\create\MockTest::testMockModel PHP Method

testMockModel() public method

public testMockModel ( )
    public function testMockModel()
    {
        $this->request->params += array('command' => 'create', 'action' => 'mock', 'args' => array('model', 'Posts'));
        $mock = new Mock(array('request' => $this->request, 'classes' => $this->classes));
        $mock->path = $this->_testPath;
        $mock->run('mock');
        $expected = "MockPosts created in tests/mocks/models/MockPosts.php.\n";
        $result = $mock->response->output;
        $this->assertEqual($expected, $result);
        $expected = <<<'test'


namespace create_test\tests\mocks\models;

class MockPosts extends \create_test\models\Posts {


}


test;
        $replace = array("<?php", "?>");
        $result = str_replace($replace, '', file_get_contents($this->_testPath . '/create_test/tests/mocks/models/MockPosts.php'));
        $this->assertEqual($expected, $result);
    }