save() public method

public save ( $template, $params = [] )
 public function testSaveWithLibrary()
 {
     chdir($this->_testPath);
     $create = new MockCreate(array('request' => $this->request));
     $result = $create->save('test', array('namespace' => 'create_test\\tests\\cases\\models', 'use' => 'create_test\\models\\Post', 'class' => 'PostTest', 'methods' => "\tpublic function testCreate() {\n\n\t}\n"));
     $this->assertTrue($result);
     $result = $this->_testPath . '/create_test/tests/cases/models/PostTest.php';
     $this->assertTrue(file_exists($result));
     $this->_cleanUp();
 }
Beispiel #2
0
 public function testSave()
 {
     chdir($this->_testPath);
     $this->request->params = array('library' => 'create_test', 'template' => 'test');
     $create = new MockCreate(array('request' => $this->request));
     $result = $create->save(array('namespace' => 'create_test\\tests\\cases\\models', 'use' => 'create_test\\models\\Posts', 'class' => 'PostTest', 'methods' => "\tpublic function testCreate() {\n\n\t}\n"));
     $this->assertNotEmpty($result);
     $result = $this->_testPath . '/create_test/tests/cases/models/PostTest.php';
     $this->assertFileExists($result);
     $this->_cleanUp();
 }