Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
script:
- vendor/bin/phpunit
install:
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@
"php": ">=5.6.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
"phpunit/phpunit": "^5.7|^6.5"
},
"autoload": {
"psr-4": {
"DbTools\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"DbTools\\Tests\\": "tests/"
}
}
}
6 changes: 5 additions & 1 deletion tests/DatabaseTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?php

namespace DbTools\Tests;

use DbTools\Database;
use PDO;
use PHPUnit\Framework\TestCase;

class DatabaseTest extends PHPUnit_Framework_TestCase
class DatabaseTest extends TestCase
{
public function testSetConfig()
{
Expand Down
6 changes: 5 additions & 1 deletion tests/ModelTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?php

namespace DbTools\Tests;

use DbTools\Model;
use stdClass;
use PHPUnit\Framework\TestCase;

class ModelTest extends PHPUnit_Framework_TestCase
class ModelTest extends TestCase
{
public function testConstructorAndGet()
{
Expand Down
6 changes: 5 additions & 1 deletion tests/PagerTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<?php

namespace DbTools\Tests;

use DbTools\Pager;
use DbTools\Database;
use stdClass;
use PHPUnit\Framework\TestCase;

class PagerTest extends PHPUnit_Framework_TestCase
class PagerTest extends TestCase
{

public function invalidPageValues()
Expand Down
14 changes: 8 additions & 6 deletions tests/RestResourceTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

namespace DbTools\Tests;

use DbTools\RestResource;
use PHPUnit\Framework\TestCase;

class TestRestResource extends RestResource
{
Expand All @@ -24,7 +27,7 @@ public function formatEntity($entity)
}
}

class RestResourceTest extends PHPUnit_Framework_TestCase
class RestResourceTest extends TestCase
{

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -71,11 +74,10 @@ public function testValidSort($sort, $sql)
$test->processRequest([
'sort' => $sort
]);
if ( $sql ) {
$opt = $test->getModelFilters();
$this->assertArrayHasKey('order_by', $opt);
$this->assertEquals($sql, $opt['order_by']);
}

$opt = $test->getModelFilters();
$this->assertArrayHasKey('order_by', $opt);
$this->assertEquals($sql, $opt['order_by']);
}

/**
Expand Down
11 changes: 9 additions & 2 deletions tests/TableModelTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<?php

namespace DbTools\Tests;

use DbTools\TableModel;
use DbTools\Database;
use ReflectionMethod;
use DateTime;
use DateTimeZone;
use stdClass;
use PHPUnit\Framework\TestCase;

class ConcreteTableModel extends TableModel
{
Expand Down Expand Up @@ -42,7 +49,7 @@ static protected function afterGetBy($dbh, array $opt, & $obj)
}
}

class TableModelTest extends PHPUnit_Framework_TestCase
class TableModelTest extends TestCase
{
static protected $id;

Expand Down Expand Up @@ -114,7 +121,7 @@ public function testLimit()
public function testGetBy()
{
$obj = ConcreteTableModel::getById(self::$id);
$this->assertInstanceOf('ConcreteTableModel', $obj);
$this->assertInstanceOf(ConcreteTableModel::class, $obj);
$this->assertNotEmpty(ConcreteTableModel::getLastSelectQuery());
}

Expand Down