diff --git a/lib/zerobin/db.php b/lib/zerobin/db.php index 4475bfea..7171bc5a 100644 --- a/lib/zerobin/db.php +++ b/lib/zerobin/db.php @@ -607,7 +607,7 @@ class zerobin_db extends zerobin_abstract case '0.21': // create the meta column if necessary (pre 0.21 change) try { - self::$_db->exec('SELECT meta FROM ' . self::$_prefix . 'paste LIMIT 1;', array()); + self::$_db->exec('SELECT meta FROM ' . self::$_prefix . 'paste LIMIT 1;'); } catch (PDOException $e) { self::$_db->exec('ALTER TABLE ' . self::$_prefix . 'paste ADD COLUMN meta TEXT;'); } diff --git a/tst/zerobin.php b/tst/zerobin.php index 1c9d0daa..dc404a5e 100644 --- a/tst/zerobin.php +++ b/tst/zerobin.php @@ -295,7 +295,7 @@ class zerobinTest extends PHPUnit_Framework_TestCase ); $this->assertTrue($this->_model->exists($response['id']), 'paste exists after posting data'); $paste = $this->_model->read($response['id']); - $this->assertEquals($time + 300, $paste->meta->expire_date, 'time is set correctly'); + $this->assertGreaterThanOrEqual($time + 300, $paste->meta->expire_date, 'time is set correctly'); } /** @@ -327,8 +327,8 @@ class zerobinTest extends PHPUnit_Framework_TestCase ); $this->assertTrue($this->_model->exists($response['id']), 'paste exists after posting data'); $paste = $this->_model->read($response['id']); - $this->assertEquals($time + 300, $paste->meta->expire_date, 'time is set correctly'); - $this->assertEquals(1, $paste->meta->opendiscussion, 'time is set correctly'); + $this->assertGreaterThanOrEqual($time + 300, $paste->meta->expire_date, 'time is set correctly'); + $this->assertEquals(1, $paste->meta->opendiscussion, 'discussion is enabled'); } /**