33namespace AntiMattr \Tests \MongoDB \Migrations \Configuration ;
44
55use AntiMattr \MongoDB \Migrations \Configuration \Configuration ;
6- use AntiMattr \ TestCase \ AntiMattrTestCase ;
6+ use PHPUnit \ Framework \ TestCase ;
77
8- class ConfigurationTest extends AntiMattrTestCase
8+ class ConfigurationTest extends TestCase
99{
1010 private $ configuration ;
1111 private $ connection ;
1212
1313 protected function setUp ()
1414 {
15- $ this ->connection = $ this ->buildMock ('Doctrine\MongoDB\Connection ' );
15+ $ this ->connection = $ this ->createMock ('Doctrine\MongoDB\Connection ' );
1616 $ this ->configuration = new Configuration ($ this ->connection );
1717 }
1818
@@ -28,8 +28,8 @@ public function testGetCollection()
2828 $ this ->configuration ->setMigrationsDatabaseName ('test_antimattr_migrations ' );
2929 $ this ->configuration ->setMigrationsCollectionName ('antimattr_migration_versions_test ' );
3030
31- $ expectedCollection = $ this ->buildMock ('Doctrine\MongoDB\Collection ' );
32- $ database = $ this ->buildMock ('Doctrine\MongoDB\Database ' );
31+ $ expectedCollection = $ this ->createMock ('Doctrine\MongoDB\Collection ' );
32+ $ database = $ this ->createMock ('Doctrine\MongoDB\Database ' );
3333
3434 $ this ->connection ->expects ($ this ->once ())
3535 ->method ('selectDatabase ' )
@@ -52,8 +52,8 @@ public function testGetCurrentVersion()
5252 $ directory = dirname (__DIR__ ) . '/Resources/Migrations/ ' ;
5353 $ this ->configuration ->registerMigrationsFromDirectory ($ directory );
5454
55- $ collection = $ this ->buildMock ('Doctrine\MongoDB\Collection ' );
56- $ database = $ this ->buildMock ('Doctrine\MongoDB\Database ' );
55+ $ collection = $ this ->createMock ('Doctrine\MongoDB\Collection ' );
56+ $ database = $ this ->createMock ('Doctrine\MongoDB\Database ' );
5757
5858 $ this ->connection ->expects ($ this ->once ())
5959 ->method ('selectDatabase ' )
@@ -65,7 +65,7 @@ public function testGetCurrentVersion()
6565 ->with ('antimattr_migration_versions_test ' )
6666 ->willReturn ($ collection );
6767
68- $ cursor = $ this ->buildMock ('Doctrine\MongoDB\Cursor ' );
68+ $ cursor = $ this ->createMock ('Doctrine\MongoDB\Cursor ' );
6969
7070 $ in = ['v ' => ['$in ' => ['20140822185742 ' , '20140822185743 ' , '20140822185744 ' ]]];
7171
@@ -97,7 +97,7 @@ public function testGetDatabase()
9797 {
9898 $ this ->configuration ->setMigrationsDatabaseName ('test_antimattr_migrations ' );
9999
100- $ expectedDatabase = $ this ->buildMock ('Doctrine\MongoDB\Database ' );
100+ $ expectedDatabase = $ this ->createMock ('Doctrine\MongoDB\Database ' );
101101
102102 $ this ->connection ->expects ($ this ->once ())
103103 ->method ('selectDatabase ' )
@@ -112,8 +112,8 @@ public function testGetMigratedVersions()
112112 {
113113 $ this ->prepareValidConfiguration ();
114114
115- $ collection = $ this ->buildMock ('Doctrine\MongoDB\Collection ' );
116- $ database = $ this ->buildMock ('Doctrine\MongoDB\Database ' );
115+ $ collection = $ this ->createMock ('Doctrine\MongoDB\Collection ' );
116+ $ database = $ this ->createMock ('Doctrine\MongoDB\Database ' );
117117
118118 $ this ->connection ->expects ($ this ->once ())
119119 ->method ('selectDatabase ' )
@@ -147,8 +147,8 @@ public function testGetNumberOfExecutedMigrations()
147147 {
148148 $ this ->prepareValidConfiguration ();
149149
150- $ collection = $ this ->buildMock ('Doctrine\MongoDB\Collection ' );
151- $ database = $ this ->buildMock ('Doctrine\MongoDB\Database ' );
150+ $ collection = $ this ->createMock ('Doctrine\MongoDB\Collection ' );
151+ $ database = $ this ->createMock ('Doctrine\MongoDB\Database ' );
152152
153153 $ this ->connection ->expects ($ this ->once ())
154154 ->method ('selectDatabase ' )
@@ -160,7 +160,7 @@ public function testGetNumberOfExecutedMigrations()
160160 ->with ('antimattr_migration_versions_test ' )
161161 ->willReturn ($ collection );
162162
163- $ cursor = $ this ->buildMock ('Doctrine\MongoDB\Cursor ' );
163+ $ cursor = $ this ->createMock ('Doctrine\MongoDB\Cursor ' );
164164
165165 $ collection ->expects ($ this ->once ())
166166 ->method ('find ' )
@@ -200,13 +200,13 @@ public function testGetVersionThrowsUnknownVersionException()
200200
201201 public function testHasVersionMigrated ()
202202 {
203- $ version1 = $ this ->buildMock ('AntiMattr\MongoDB\Migrations\Version ' );
204- $ version2 = $ this ->buildMock ('AntiMattr\MongoDB\Migrations\Version ' );
203+ $ version1 = $ this ->createMock ('AntiMattr\MongoDB\Migrations\Version ' );
204+ $ version2 = $ this ->createMock ('AntiMattr\MongoDB\Migrations\Version ' );
205205
206206 $ this ->prepareValidConfiguration ();
207207
208- $ collection = $ this ->buildMock ('Doctrine\MongoDB\Collection ' );
209- $ database = $ this ->buildMock ('Doctrine\MongoDB\Database ' );
208+ $ collection = $ this ->createMock ('Doctrine\MongoDB\Collection ' );
209+ $ database = $ this ->createMock ('Doctrine\MongoDB\Database ' );
210210
211211 $ this ->connection ->expects ($ this ->once ())
212212 ->method ('selectDatabase ' )
@@ -278,8 +278,8 @@ public function testDuplicateInGetMigratedTimestampThrowsException()
278278 {
279279 $ this ->prepareValidConfiguration ();
280280
281- $ collection = $ this ->buildMock ('Doctrine\MongoDB\Collection ' );
282- $ database = $ this ->buildMock ('Doctrine\MongoDB\Database ' );
281+ $ collection = $ this ->createMock ('Doctrine\MongoDB\Collection ' );
282+ $ database = $ this ->createMock ('Doctrine\MongoDB\Database ' );
283283
284284 $ this ->connection ->expects ($ this ->once ())
285285 ->method ('selectDatabase ' )
@@ -291,7 +291,7 @@ public function testDuplicateInGetMigratedTimestampThrowsException()
291291 ->with ('antimattr_migration_versions_test ' )
292292 ->willReturn ($ collection );
293293
294- $ cursor = $ this ->buildMock ('Doctrine\MongoDB\Cursor ' );
294+ $ cursor = $ this ->createMock ('Doctrine\MongoDB\Cursor ' );
295295
296296 $ collection ->expects ($ this ->once ())
297297 ->method ('find ' )
@@ -308,8 +308,8 @@ public function testGetMigratedTimestamp()
308308 {
309309 $ this ->prepareValidConfiguration ();
310310
311- $ collection = $ this ->buildMock ('Doctrine\MongoDB\Collection ' );
312- $ database = $ this ->buildMock ('Doctrine\MongoDB\Database ' );
311+ $ collection = $ this ->createMock ('Doctrine\MongoDB\Collection ' );
312+ $ database = $ this ->createMock ('Doctrine\MongoDB\Database ' );
313313
314314 $ this ->connection ->expects ($ this ->once ())
315315 ->method ('selectDatabase ' )
@@ -321,7 +321,7 @@ public function testGetMigratedTimestamp()
321321 ->with ('antimattr_migration_versions_test ' )
322322 ->willReturn ($ collection );
323323
324- $ cursor = $ this ->buildMock ('Doctrine\MongoDB\Cursor ' );
324+ $ cursor = $ this ->createMock ('Doctrine\MongoDB\Cursor ' );
325325
326326 $ collection ->expects ($ this ->once ())
327327 ->method ('find ' )
0 commit comments