Skip to content

Commit 4748dc3

Browse files
author
Alexandre GUIDET
committed
test ok
1 parent cc75853 commit 4748dc3

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

tests/MigrateTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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
*/

tests/MigratorTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33

44
class MigratorTest extends PHPUnit_Framework_TestCase
55
{
6-
6+
public function testTrue() {
7+
$this->assertTrue(true);
8+
}
79
}

0 commit comments

Comments
 (0)