@@ -70,33 +70,29 @@ public function testStoringData()
7070
7171 $ record = $ newCollection ->findOne ();
7272 $ this ->assertNotNull ($ record );
73- $ this ->assertAttributeInstanceOf ('MongoDB\BSON\ObjectID ' , ' _id ' , $ record );
73+ $ this ->assertInstanceOf ('MongoDB\BSON\ObjectID ' , $ record-> _id );
7474 $ this ->assertSame ((string ) $ id , (string ) $ record ->_id );
75- $ this ->assertObjectHasAttribute ('foo ' , $ record );
76- $ this ->assertAttributeSame ('bar ' , 'foo ' , $ record );
77- $ this ->assertObjectHasAttribute ('length ' , $ record );
78- $ this ->assertAttributeSame (4 , 'length ' , $ record );
79- $ this ->assertObjectHasAttribute ('chunkSize ' , $ record );
80- $ this ->assertAttributeSame (2 , 'chunkSize ' , $ record );
81- $ this ->assertObjectHasAttribute ('md5 ' , $ record );
82- $ this ->assertAttributeSame ('e2fc714c4727ee9395f324cd2e7f331f ' , 'md5 ' , $ record );
75+ $ this ->assertSame ('bar ' , $ record ->foo );
76+ $ this ->assertSame (4 , $ record ->length );
77+ $ this ->assertSame (2 , $ record ->chunkSize );
78+ $ this ->assertSame ('e2fc714c4727ee9395f324cd2e7f331f ' , $ record ->md5 );
8379
8480 $ chunksCursor = $ newChunksCollection ->find ([], ['sort ' => ['n ' => 1 ]]);
8581 $ chunks = iterator_to_array ($ chunksCursor );
8682 $ firstChunk = $ chunks [0 ];
8783 $ this ->assertNotNull ($ firstChunk );
88- $ this ->assertAttributeInstanceOf ('MongoDB\BSON\ObjectID ' , ' files_id ' , $ firstChunk );
84+ $ this ->assertInstanceOf ('MongoDB\BSON\ObjectID ' , $ firstChunk-> files_id );
8985 $ this ->assertSame ((string ) $ id , (string ) $ firstChunk ->files_id );
90- $ this ->assertAttributeSame (0 , ' n ' , $ firstChunk );
91- $ this ->assertAttributeInstanceOf ('MongoDB\BSON\Binary ' , ' data ' , $ firstChunk );
86+ $ this ->assertSame (0 , $ firstChunk-> n );
87+ $ this ->assertInstanceOf ('MongoDB\BSON\Binary ' , $ firstChunk-> data );
9288 $ this ->assertSame ('ab ' , (string ) $ firstChunk ->data ->getData ());
9389
9490 $ secondChunck = $ chunks [1 ];
9591 $ this ->assertNotNull ($ secondChunck );
96- $ this ->assertAttributeInstanceOf ('MongoDB\BSON\ObjectID ' , ' files_id ' , $ secondChunck );
92+ $ this ->assertInstanceOf ('MongoDB\BSON\ObjectID ' , $ secondChunck-> files_id );
9793 $ this ->assertSame ((string ) $ id , (string ) $ secondChunck ->files_id );
98- $ this ->assertAttributeSame (1 , ' n ' , $ secondChunck );
99- $ this ->assertAttributeInstanceOf ('MongoDB\BSON\Binary ' , ' data ' , $ secondChunck );
94+ $ this ->assertSame (1 , $ secondChunck-> n );
95+ $ this ->assertInstanceOf ('MongoDB\BSON\Binary ' , $ secondChunck-> data );
10096 $ this ->assertSame ('cd ' , (string ) $ secondChunck ->data ->getData ());
10197 }
10298
@@ -164,29 +160,24 @@ public function testStoreFile()
164160 $ size = filesize ($ filename );
165161 $ record = $ newCollection ->findOne ();
166162 $ this ->assertNotNull ($ record );
167- $ this ->assertAttributeInstanceOf ('MongoDB\BSON\ObjectID ' , ' _id ' , $ record );
163+ $ this ->assertInstanceOf ('MongoDB\BSON\ObjectID ' , $ record-> _id );
168164 $ this ->assertSame ((string ) $ id , (string ) $ record ->_id );
169- $ this ->assertObjectHasAttribute ('foo ' , $ record );
170- $ this ->assertAttributeSame ('bar ' , 'foo ' , $ record );
171- $ this ->assertObjectHasAttribute ('length ' , $ record );
172- $ this ->assertAttributeSame ($ size , 'length ' , $ record );
173- $ this ->assertObjectHasAttribute ('chunkSize ' , $ record );
174- $ this ->assertAttributeSame (100 , 'chunkSize ' , $ record );
175- $ this ->assertObjectHasAttribute ('md5 ' , $ record );
176- $ this ->assertAttributeSame ($ md5 , 'md5 ' , $ record );
177- $ this ->assertObjectHasAttribute ('filename ' , $ record );
178- $ this ->assertAttributeSame ($ filename , 'filename ' , $ record );
165+ $ this ->assertSame ('bar ' , $ record ->foo );
166+ $ this ->assertSame ($ size , $ record ->length );
167+ $ this ->assertSame (100 , $ record ->chunkSize );
168+ $ this ->assertSame ($ md5 , $ record ->md5 );
169+ $ this ->assertSame ($ filename , $ record ->filename );
179170
180171 $ numberOfChunks = (int ) ceil ($ size / 100 );
181172 $ this ->assertSame ($ numberOfChunks , $ newChunksCollection ->count ());
182173 $ expectedContent = substr (file_get_contents (__FILE__ ), 0 , 100 );
183174
184175 $ firstChunk = $ newChunksCollection ->findOne ([], ['sort ' => ['n ' => 1 ]]);
185176 $ this ->assertNotNull ($ firstChunk );
186- $ this ->assertAttributeInstanceOf ('MongoDB\BSON\ObjectID ' , ' files_id ' , $ firstChunk );
177+ $ this ->assertInstanceOf ('MongoDB\BSON\ObjectID ' , $ firstChunk-> files_id );
187178 $ this ->assertSame ((string ) $ id , (string ) $ firstChunk ->files_id );
188- $ this ->assertAttributeSame (0 , ' n ' , $ firstChunk );
189- $ this ->assertAttributeInstanceOf ('MongoDB\BSON\Binary ' , ' data ' , $ firstChunk );
179+ $ this ->assertSame (0 , $ firstChunk-> n );
180+ $ this ->assertInstanceOf ('MongoDB\BSON\Binary ' , $ firstChunk-> data );
190181 $ this ->assertSame ($ expectedContent , (string ) $ firstChunk ->data ->getData ());
191182 }
192183
@@ -209,29 +200,24 @@ public function testStoreFileResource()
209200 $ filename = basename (__FILE__ );
210201 $ record = $ newCollection ->findOne ();
211202 $ this ->assertNotNull ($ record );
212- $ this ->assertAttributeInstanceOf ('MongoDB\BSON\ObjectID ' , ' _id ' , $ record );
203+ $ this ->assertInstanceOf ('MongoDB\BSON\ObjectID ' , $ record-> _id );
213204 $ this ->assertSame ((string ) $ id , (string ) $ record ->_id );
214- $ this ->assertObjectHasAttribute ('foo ' , $ record );
215- $ this ->assertAttributeSame ('bar ' , 'foo ' , $ record );
216- $ this ->assertObjectHasAttribute ('length ' , $ record );
217- $ this ->assertAttributeSame ($ size , 'length ' , $ record );
218- $ this ->assertObjectHasAttribute ('chunkSize ' , $ record );
219- $ this ->assertAttributeSame (100 , 'chunkSize ' , $ record );
220- $ this ->assertObjectHasAttribute ('md5 ' , $ record );
221- $ this ->assertAttributeSame ($ md5 , 'md5 ' , $ record );
222- $ this ->assertObjectHasAttribute ('filename ' , $ record );
223- $ this ->assertAttributeSame ('test.php ' , 'filename ' , $ record );
205+ $ this ->assertSame ('bar ' , $ record ->foo );
206+ $ this ->assertSame ($ size , $ record ->length );
207+ $ this ->assertSame (100 , $ record ->chunkSize );
208+ $ this ->assertSame ($ md5 , $ record ->md5 );
209+ $ this ->assertSame ('test.php ' , $ record ->filename );
224210
225211 $ numberOfChunks = (int ) ceil ($ size / 100 );
226212 $ this ->assertSame ($ numberOfChunks , $ newChunksCollection ->count ());
227213 $ expectedContent = substr (file_get_contents (__FILE__ ), 0 , 100 );
228214
229215 $ firstChunk = $ newChunksCollection ->findOne ([], ['sort ' => ['n ' => 1 ]]);
230216 $ this ->assertNotNull ($ firstChunk );
231- $ this ->assertAttributeInstanceOf ('MongoDB\BSON\ObjectID ' , ' files_id ' , $ firstChunk );
217+ $ this ->assertInstanceOf ('MongoDB\BSON\ObjectID ' , $ firstChunk-> files_id );
232218 $ this ->assertSame ((string ) $ id , (string ) $ firstChunk ->files_id );
233- $ this ->assertAttributeSame (0 , ' n ' , $ firstChunk );
234- $ this ->assertAttributeInstanceOf ('MongoDB\BSON\Binary ' , ' data ' , $ firstChunk );
219+ $ this ->assertSame (0 , $ firstChunk-> n );
220+ $ this ->assertInstanceOf ('MongoDB\BSON\Binary ' , $ firstChunk-> data );
235221 $ this ->assertSame ($ expectedContent , (string ) $ firstChunk ->data ->getData ());
236222 }
237223
@@ -260,18 +246,13 @@ public function testStoreUpload()
260246 $ size = filesize (__FILE__ );
261247 $ record = $ newCollection ->findOne ();
262248 $ this ->assertNotNull ($ record );
263- $ this ->assertAttributeInstanceOf ('MongoDB\BSON\ObjectID ' , ' _id ' , $ record );
249+ $ this ->assertInstanceOf ('MongoDB\BSON\ObjectID ' , $ record-> _id );
264250 $ this ->assertSame ((string ) $ id , (string ) $ record ->_id );
265- $ this ->assertObjectHasAttribute ('foo ' , $ record );
266- $ this ->assertAttributeSame ('bar ' , 'foo ' , $ record );
267- $ this ->assertObjectHasAttribute ('length ' , $ record );
268- $ this ->assertAttributeSame ($ size , 'length ' , $ record );
269- $ this ->assertObjectHasAttribute ('chunkSize ' , $ record );
270- $ this ->assertAttributeSame (100 , 'chunkSize ' , $ record );
271- $ this ->assertObjectHasAttribute ('md5 ' , $ record );
272- $ this ->assertAttributeSame ($ md5 , 'md5 ' , $ record );
273- $ this ->assertObjectHasAttribute ('filename ' , $ record );
274- $ this ->assertAttributeSame ('test.php ' , 'filename ' , $ record );
251+ $ this ->assertSame ('bar ' , $ record ->foo );
252+ $ this ->assertSame ($ size , $ record ->length );
253+ $ this ->assertSame (100 , $ record ->chunkSize );
254+ $ this ->assertSame ($ md5 , $ record ->md5 );
255+ $ this ->assertSame ('test.php ' , $ record ->filename );
275256
276257 $ numberOfChunks = (int ) ceil ($ size / 100 );
277258 $ this ->assertSame ($ numberOfChunks , $ newChunksCollection ->count ());
0 commit comments