summaryrefslogtreecommitdiff
path: root/libmysqlpp/mock.cpp
blob: 3c749de72447466577d682ef92022b0d43f3c0ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "connection.h"
#include "mock.h"
#include <buffer.h>

namespace MySQL {

Mock::Mock(const std::string & name, const std::vector<boost::filesystem::path> & ss) :
	MockServerDatabase("options=p2testmysql", name, "mysql")
{
	CreateNewDatabase();
	PlaySchemaScripts(ss);
}

DB::Connection *
Mock::openConnection() const
{
	return new Connection(stringbf("options=p2testmysql;database=%s", testDbName));
}

Mock::~Mock()
{
	DropDatabase();
}

}