Skip to content

Commit

Permalink
Sqlite in nonblocking mode
Browse files Browse the repository at this point in the history
Debian Package renamed to php-vitexsoftware-ease-fluentpdo
More successfull unit tests
  • Loading branch information
Vitexus committed Jul 29, 2020
1 parent 9a7a551 commit ad3d3fa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ prepare:
deb:
debuild -us -uc

phpunit:
phpunit: prepare
vendor/bin/phpunit --bootstrap tests/bootstrap.php --configuration phpunit.xml


Expand Down
7 changes: 4 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: php-ease-fluentpdo
Source: php-vitexsoftware-ease-fluentpdo
Build-Depends: debhelper (>= 7.0.50~)
Section: web
Standards-Version: 3.9.8
Expand All @@ -7,10 +7,11 @@ Uploaders: Vitex <vitex@hippy.cz>
Priority: optional
Homepage: https://github.com/VitexSoftware/php-ease-fluentpdo

Package: php-ease-fluentpdo
Depends: ${misc:Depends},php-ease-core,php-pdo-mysql|php-pdo-pgsql|php-pdo-sqlite
Package: php-vitexsofware-ease-fluentpdo
Depends: ${misc:Depends},php-ease-core,php-pdo-mysql|php-pdo-pgsql|php-pdo-sqlite|php-pdo-sqlserver
Architecture: all
Conflicts: ease-framework
Replaces: php-ease-fluentpdo
Section: web
Priority: optional
Description: Database support for EasePHP Framework
Expand Down
1 change: 1 addition & 0 deletions src/Ease/SQL/Orm.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public function pdoConnect($options = []) {
case 'sqlite':
if (file_exists($this->database)) {
$result = new \PDO($this->dbType . ':' . $this->database);
$result->exec('PRAGMA journal_mode = wal;');
} else {
throw new \PDOException(sprintf(_('unable to open database file %s'), $this->database));
}
Expand Down
16 changes: 8 additions & 8 deletions tests/src/Ease/SQL/EngineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ public function testGetAll() {
* @covers Ease\SQL\Engine::setUp
*/
public function testSetUp() {
$this->assertEquals('', $this->object->setUp());
$this->object->setUp();
$this->assertNotNull($this->object->dbType);
}

/**
Expand All @@ -110,7 +111,7 @@ public function testPdoConnect() {
* @covers Ease\SQL\Engine::getPdo
*/
public function testGetPdo() {
$this->assertEquals('PDO', get_class($this->object->GetPdo()));
$this->assertInstanceOf('PDO', $this->object->GetPdo());
}

/**
Expand Down Expand Up @@ -138,9 +139,7 @@ public function testGetColumnsFromSQL() {
* @covers Ease\SQL\Engine::getDataFromSQL
*/
public function testGetDataFromSQL() {
$this->assertEquals('', $this->object->GetDataFromSQL());
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
$this->assertEquals('', $this->object->getDataFromSQL(1));
}

/**
Expand All @@ -154,21 +153,22 @@ public function testLoadFromSQL() {
* @covers Ease\SQL\Engine::dbreload
*/
public function testDbreload() {
$this->assertEquals('', $this->object->Dbreload());
$this->assertEquals('', $this->object->dbreload());
}

/**
* @covers Ease\SQL\Engine::dbsync
*/
public function testDbsync() {
$this->assertEquals('', $this->object->Dbsync());
$this->object->setData(['id'=>3,'key'=>'thrid','value'=>'newone']);
$this->assertEquals('', $this->object->dbsync());
}

/**
* @covers Ease\SQL\Engine::updateToSQL
*/
public function testUpdateToSQL() {
$this->assertEquals('', $this->object->updateToSQL());
$this->assertEquals(1, $this->object->updateToSQL(['id'=>1,'key'=>'foo','value'=>'updated']));
}

/**
Expand Down

0 comments on commit ad3d3fa

Please sign in to comment.