14 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
15 $logger->expects( $this->exactly( 3 ) )->method(
'warning' );
18 $tp->setLogger( $logger );
19 $tp->setExpectation(
'maxAffected', 100, __METHOD__ );
21 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
22 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 3,
true, 200 );
23 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 3,
true, 200 );
24 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 1, 400 );
28 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
30 $logger->expects( $this->exactly( 2 ) )->method(
'warning' );
33 $tp->setLogger( $logger );
34 $tp->setExpectation(
'readQueryTime', 5, __METHOD__ );
36 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
37 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 10,
false, 1 );
38 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 10,
false, 1 );
39 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 0, 0 );
43 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
45 $logger->expects( $this->exactly( 4 ) )->method(
'warning' );
48 $tp->setLogger( $logger );
49 $tp->setExpectation(
'writeQueryTime', 5, __METHOD__ );
51 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
52 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 10,
true, 1 );
53 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 10,
true, 1 );
54 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 20, 1 );
58 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
59 $logger->expects( $this->exactly( 1 ) )->method(
'warning' );
62 $tp->setLogger( $logger );
63 $tp->setExpectation(
'maxAffected', 100, __METHOD__ );
65 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
66 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 1, 200 );
70 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
72 $logger->expects( $this->exactly( 2 ) )->method(
'warning' );
75 $tp->setLogger( $logger );
76 $tp->setExpectation(
'writeQueryTime', 5, __METHOD__ );
78 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
79 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 10, 1 );
114 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
115 $logger->expects( $this->exactly( 2 ) )->method(
'warning' );
118 $tp->setLogger( $logger );
119 $tp->setExpectation(
'queries', 2, __METHOD__ );
121 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 0.01,
false, 0 );
122 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 0.01,
false, 0 );
123 $tp->recordQueryCompletion(
"SQL 3", microtime(
true ) - 0.01,
false, 0 );
124 $tp->recordQueryCompletion(
"SQL 4", microtime(
true ) - 0.01,
false, 0 );
128 $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
129 $logger->expects( $this->exactly( 2 ) )->method(
'warning' );
132 $tp->setLogger( $logger );
133 $tp->setExpectation(
'writes', 2, __METHOD__ );
135 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 0.01,
false, 0 );
136 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 0.01,
false, 0 );
137 $tp->recordQueryCompletion(
"SQL 3", microtime(
true ) - 0.01,
false, 0 );
138 $tp->recordQueryCompletion(
"SQL 4", microtime(
true ) - 0.01,
false, 0 );
140 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
141 $tp->recordQueryCompletion(
"SQL 1w", microtime(
true ) - 0.01,
true, 2 );
142 $tp->recordQueryCompletion(
"SQL 2w", microtime(
true ) - 0.01,
true, 5 );
143 $tp->recordQueryCompletion(
"SQL 3w", microtime(
true ) - 0.01,
true, 3 );
144 $tp->recordQueryCompletion(
"SQL 4w", microtime(
true ) - 0.01,
true, 1 );
145 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 1, 1 );