8 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
9 $logger->expects( $this->exactly( 3 ) )->method(
'info' );
12 $tp->setLogger( $logger );
13 $tp->setExpectation(
'maxAffected', 100, __METHOD__ );
15 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
16 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 3,
true, 200 );
17 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 3,
true, 200 );
18 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 1, 400 );
22 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
24 $logger->expects( $this->exactly( 2 ) )->method(
'info' );
27 $tp->setLogger( $logger );
28 $tp->setExpectation(
'readQueryTime', 5, __METHOD__ );
30 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
31 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 10,
false, 1 );
32 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 10,
false, 1 );
33 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 0, 0 );
37 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
39 $logger->expects( $this->exactly( 4 ) )->method(
'info' );
42 $tp->setLogger( $logger );
43 $tp->setExpectation(
'writeQueryTime', 5, __METHOD__ );
45 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
46 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 10,
true, 1 );
47 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 10,
true, 1 );
48 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 20, 1 );
52 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
53 $logger->expects( $this->exactly( 1 ) )->method(
'info' );
56 $tp->setLogger( $logger );
57 $tp->setExpectation(
'maxAffected', 100, __METHOD__ );
59 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
60 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 1, 200 );
64 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
66 $logger->expects( $this->exactly( 2 ) )->method(
'info' );
69 $tp->setLogger( $logger );
70 $tp->setExpectation(
'writeQueryTime', 5, __METHOD__ );
72 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
73 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 10, 1 );
108 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
109 $logger->expects( $this->exactly( 2 ) )->method(
'info' );
112 $tp->setLogger( $logger );
113 $tp->setExpectation(
'queries', 2, __METHOD__ );
115 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 0.01,
false, 0 );
116 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 0.01,
false, 0 );
117 $tp->recordQueryCompletion(
"SQL 3", microtime(
true ) - 0.01,
false, 0 );
118 $tp->recordQueryCompletion(
"SQL 4", microtime(
true ) - 0.01,
false, 0 );
122 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
123 $logger->expects( $this->exactly( 2 ) )->method(
'info' );
126 $tp->setLogger( $logger );
127 $tp->setExpectation(
'writes', 2, __METHOD__ );
129 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 0.01,
false, 0 );
130 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 0.01,
false, 0 );
131 $tp->recordQueryCompletion(
"SQL 3", microtime(
true ) - 0.01,
false, 0 );
132 $tp->recordQueryCompletion(
"SQL 4", microtime(
true ) - 0.01,
false, 0 );
134 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
135 $tp->recordQueryCompletion(
"SQL 1w", microtime(
true ) - 0.01,
true, 2 );
136 $tp->recordQueryCompletion(
"SQL 2w", microtime(
true ) - 0.01,
true, 5 );
137 $tp->recordQueryCompletion(
"SQL 3w", microtime(
true ) - 0.01,
true, 3 );
138 $tp->recordQueryCompletion(
"SQL 4w", microtime(
true ) - 0.01,
true, 1 );
139 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 1, 1 );