File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,32 @@ public function testStoresDuration()
4343
4444 //--------------------------------------------------------------------
4545
46+ public function testGetStartTime ()
47+ {
48+ $ query = new Query ($ this ->db );
49+
50+ $ start = microtime (true );
51+
52+ $ query ->setDuration ($ start , $ start + 5 );
53+
54+ $ this ->assertEquals (round ($ start , 4 ), $ query ->getStartTime (true ));
55+ }
56+
57+ //--------------------------------------------------------------------
58+
59+ public function testGetStartTimeNumberFormat ()
60+ {
61+ $ query = new Query ($ this ->db );
62+
63+ $ start = microtime (true );
64+
65+ $ query ->setDuration ($ start , $ start + 5 );
66+
67+ $ this ->assertEquals (number_format ($ start , 6 ), $ query ->getStartTime ());
68+ }
69+
70+ //--------------------------------------------------------------------
71+
4672 public function testsStoresErrorInformation ()
4773 {
4874 $ query = new Query ($ this ->db );
Original file line number Diff line number Diff line change @@ -382,4 +382,24 @@ public function testCurrentSuccess()
382382 $ this ->assertEquals ('001 ' , $ version );
383383 $ this ->assertTrue (db_connect ()->tableExists ('foo ' ));
384384 }
385+
386+ public function testLatestAll ()
387+ {
388+ $ config = $ this ->config ;
389+ $ config ->type = 'sequential ' ;
390+ $ runner = new MigrationRunner ($ config );
391+ $ runner ->setSilent (false );
392+
393+ $ runner = $ runner ->setPath ($ this ->start );
394+
395+ vfsStream::copyFromFileSystem (
396+ TESTPATH . '_support/Database/SupportMigrations ' ,
397+ $ this ->root
398+ );
399+
400+ $ version = $ runner ->latestAll ();
401+
402+ $ this ->assertTrue ($ version );
403+ $ this ->assertTrue (db_connect ()->tableExists ('foo ' ));
404+ }
385405}
You can’t perform that action at this time.
0 commit comments