@@ -231,10 +231,10 @@ public function testVersionThrowsMigrationGapException()
231231
232232 $ version = $ runner ->version (0 );
233233
234- $ this ->assertEquals ($ version, ' 002 ' );
234+ $ this ->assertFalse ($ version );
235235 }
236236
237- public function testVersionReturnsTrueWhenNothingToDo ()
237+ public function testVersionReturnsFalseWhenNothingToDo ()
238238 {
239239 $ config = $ this ->config ;
240240 $ config ->type = 'sequential ' ;
@@ -246,7 +246,7 @@ public function testVersionReturnsTrueWhenNothingToDo()
246246
247247 $ version = $ runner ->version (0 );
248248
249- $ this ->assertTrue ($ version );
249+ $ this ->assertFalse ($ version );
250250 }
251251
252252 /**
@@ -266,7 +266,7 @@ public function testVersionWithNoClassInFile()
266266
267267 $ version = $ runner ->version (1 );
268268
269- $ this ->assertEquals ( ' 001 ' , $ version );
269+ $ this ->assertFalse ( $ version );
270270 }
271271
272272 public function testVersionReturnsUpDownSuccess ()
@@ -290,7 +290,7 @@ public function testVersionReturnsUpDownSuccess()
290290
291291 $ version = $ runner ->version (0 );
292292
293- $ this ->assertTrue ( $ version );
293+ $ this ->assertEquals ( ' 000 ' , $ version );
294294 $ this ->assertFalse (db_connect ()->tableExists ('foo ' ));
295295 }
296296
@@ -314,6 +314,26 @@ public function testLatestSuccess()
314314 $ this ->assertTrue (db_connect ()->tableExists ('foo ' ));
315315 }
316316
317+ public function testVersionReturnsDownSuccess ()
318+ {
319+ $ config = $ this ->config ;
320+ $ config ->type = 'sequential ' ;
321+ $ runner = new MigrationRunner ($ config );
322+ $ runner ->setSilent (false );
323+
324+ $ runner = $ runner ->setPath ($ this ->start );
325+
326+ vfsStream::copyFromFileSystem (
327+ TESTPATH . '_support/Database/SupportMigrations ' ,
328+ $ this ->root
329+ );
330+
331+ $ version = $ runner ->version (0 );
332+
333+ $ this ->assertEquals ('000 ' , $ version );
334+ $ this ->assertFalse (db_connect ()->tableExists ('foo ' ));
335+ }
336+
317337 public function testCurrentSuccess ()
318338 {
319339 $ config = $ this ->config ;
0 commit comments