@@ -26,13 +26,13 @@ final class ResultTest extends TestCase
2626 */
2727 public function testCurrent (): void
2828 {
29- $ stub = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
30- $ stub ->expects ($ this ->any ())
29+ $ mock = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
30+ $ mock ->expects ($ this ->any ())
3131 ->method ('fetch ' )
3232 ->willReturnCallback (fn () => uniqid ());
3333
3434 $ result = new Result ();
35- $ result ->initialize ($ stub , null );
35+ $ result ->initialize ($ mock , null );
3636
3737 self ::assertEquals ($ result ->current (), $ result ->current ());
3838 }
@@ -50,13 +50,13 @@ public function testFetchModeException(): void
5050 */
5151 public function testFetchModeAnonymousObject (): void
5252 {
53- $ stub = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
54- $ stub ->expects ($ this ->any ())
53+ $ mock = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
54+ $ mock ->expects ($ this ->any ())
5555 ->method ('fetch ' )
5656 ->willReturnCallback (fn () => new stdClass ());
5757
5858 $ result = new Result ();
59- $ result ->initialize ($ stub , null );
59+ $ result ->initialize ($ mock , null );
6060 $ result ->setFetchMode (PDO ::FETCH_OBJ );
6161
6262 self ::assertEquals (5 , $ result ->getFetchMode ());
@@ -68,62 +68,62 @@ public function testFetchModeAnonymousObject(): void
6868 */
6969 public function testFetchModeRange (): void
7070 {
71- $ stub = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
72- $ stub ->expects ($ this ->any ())
71+ $ mock = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
72+ $ mock ->expects ($ this ->any ())
7373 ->method ('fetch ' )
7474 ->willReturnCallback (fn () => new stdClass ());
7575 $ result = new Result ();
76- $ result ->initialize ($ stub , null );
76+ $ result ->initialize ($ mock , null );
7777 $ result ->setFetchMode (PDO ::FETCH_NAMED );
7878 self ::assertEquals (11 , $ result ->getFetchMode ());
7979 self ::assertInstanceOf ('stdClass ' , $ result ->current ());
8080 }
8181
8282 public function testCountWithNullRowCountDelegatesToPdoStatement (): void
8383 {
84- $ stub = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
85- $ stub ->expects ($ this ->once ())
84+ $ mock = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
85+ $ mock ->expects ($ this ->once ())
8686 ->method ('rowCount ' )
8787 ->willReturn (4 );
8888
8989 $ result = new Result ();
90- $ result ->initialize ($ stub , null , null );
90+ $ result ->initialize ($ mock , null , null );
9191
9292 self ::assertSame (4 , $ result ->count ());
9393 }
9494
9595 public function testCountWithZeroRowCountReturnsZeroWithoutQueryingPdo (): void
9696 {
97- $ stub = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
98- $ stub ->expects ($ this ->never ())
97+ $ mock = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
98+ $ mock ->expects ($ this ->never ())
9999 ->method ('rowCount ' );
100100
101101 $ result = new Result ();
102- $ result ->initialize ($ stub , null , 0 );
102+ $ result ->initialize ($ mock , null , 0 );
103103
104104 self ::assertSame (0 , $ result ->count ());
105105 }
106106
107107 public function testCountWithIntRowCountReturnsValueWithoutQueryingPdo (): void
108108 {
109- $ stub = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
110- $ stub ->expects ($ this ->never ())
109+ $ mock = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
110+ $ mock ->expects ($ this ->never ())
111111 ->method ('rowCount ' );
112112
113113 $ result = new Result ();
114- $ result ->initialize ($ stub , null , 7 );
114+ $ result ->initialize ($ mock , null , 7 );
115115
116116 self ::assertSame (7 , $ result ->count ());
117117 }
118118
119119 public function testCountWithClosureRowCountInvokesClosure (): void
120120 {
121- $ stub = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
122- $ stub ->expects ($ this ->never ())
121+ $ mock = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
122+ $ mock ->expects ($ this ->never ())
123123 ->method ('rowCount ' );
124124
125125 $ result = new Result ();
126- $ result ->initialize ($ stub , null , fn () => 3 );
126+ $ result ->initialize ($ mock , null , fn () => 3 );
127127
128128 self ::assertSame (3 , $ result ->count ());
129129 }
@@ -136,15 +136,15 @@ public function testMultipleRewind(): void
136136 ];
137137 $ position = 0 ;
138138
139- $ stub = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
140- assert ($ stub instanceof PDOStatement); // to suppress IDE type warnings
141- $ stub ->expects ($ this ->any ())
139+ $ mock = $ this ->getMockBuilder (PDOStatement::class)->getMock ();
140+ assert ($ mock instanceof PDOStatement); // to suppress IDE type warnings
141+ $ mock ->expects ($ this ->any ())
142142 ->method ('fetch ' )
143143 ->willReturnCallback (function () use ($ data , &$ position ) {
144144 return $ data [$ position ++];
145145 });
146146 $ result = new Result ();
147- $ result ->initialize ($ stub , null );
147+ $ result ->initialize ($ mock , null );
148148
149149 $ result ->rewind ();
150150 $ result ->rewind ();
0 commit comments