Exemplo n.º 1
0
 public function testCleanup()
 {
     $expectedSqlFile = __DIR__ . DIRECTORY_SEPARATOR . 'drop_create_database.sql';
     $this->_model->expects($this->once())->method('_createScript')->with($expectedSqlFile, 'DROP DATABASE `schema`; CREATE DATABASE `schema`');
     $this->_shell->expects($this->once())->method('execute')->with('mysql --protocol=TCP --host=%s --user=%s --password=%s %s < %s', array('host', 'user', 'pass', 'schema', $expectedSqlFile));
     $this->_model->cleanup();
 }
Exemplo n.º 2
0
 public function testRestoreBackup()
 {
     $command = 'mysql ' . $this->_commandPrefix . ' ' . escapeshellarg('schema') . ' < ' . escapeshellarg($this->_varDir . DIRECTORY_SEPARATOR . 'test.sql');
     $this->_model->expects($this->once())->method('_exec')->with($this->equalTo($command));
     $this->_model->restoreBackup('test');
 }