File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,14 +26,21 @@ public static function setUpBeforeClass() {
2626
2727 self ::$ migrationPath = realpath (dirname (__FILE__ )) . "/../migrations " ;
2828
29- exec ('rm ' . self ::$ migrationPath . '/* ' );
29+ if (! self ::is_dir_empty (self ::$ migrationPath )) {
30+ exec ('rm ' . self ::$ migrationPath . '/* ' );
31+ }
3032 }
3133
3234 public function setUp () {
3335 self ::$ db = new PDO ('sqlite: ' . self ::$ dbName , '' , '' );
3436 self ::$ db ->setAttribute (PDO ::ATTR_ERRMODE , PDO ::ERRMODE_EXCEPTION );
3537 }
3638
39+ public static function is_dir_empty ($ dir ) {
40+ if (!is_readable ($ dir )) return NULL ;
41+ return (count (scandir ($ dir )) == 2 );
42+ }
43+
3744 /**
3845 * @Test
3946 */
Original file line number Diff line number Diff line change 33
44class MigratorTest extends PHPUnit_Framework_TestCase
55{
6-
6+ public function testTrue () {
7+ $ this ->assertTrue (true );
8+ }
79}
You can’t perform that action at this time.
0 commit comments