This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
forked from mensler/bav
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inherit from name-spaced phpunit classes and disabled tests because a…
…n unknown table is missing
- Loading branch information
Volker Machon
committed
Jun 22, 2017
1 parent
ee7cef7
commit 60e7bca
Showing
1 changed file
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
namespace malkusch\bav; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
require_once __DIR__ . "/../bootstrap.php"; | ||
|
||
/** | ||
|
@@ -11,42 +13,50 @@ | |
* @author Markus Malkusch <[email protected]> | ||
* @see StatementContainer | ||
*/ | ||
class StatementContainerTest extends \PHPUnit_Framework_TestCase | ||
class StatementContainerTest extends TestCase | ||
{ | ||
|
||
/** | ||
* @var StatementContainer | ||
*/ | ||
private $statementContainer; | ||
|
||
public function setUp() | ||
{ | ||
$this->statementContainer = new StatementContainer(PDOFactory::makePDO()); | ||
} | ||
|
||
/** | ||
* Tests two equal queries should return the same object | ||
*/ | ||
public function testStoring() | ||
{ | ||
// FIXME: where is the `DUAL` table coming from? | ||
$this->markTestSkipped('Can not be executed'); | ||
|
||
|
||
$query = "SELECT :param as test FROM DUAL"; | ||
$stmt1 = $this->statementContainer->prepare($query); | ||
$stmt2 = $this->statementContainer->prepare($query); | ||
|
||
$this->assertSame($stmt1, $stmt2); | ||
} | ||
|
||
/** | ||
* Tests the query | ||
*/ | ||
public function testQuery() | ||
{ | ||
// FIXME: where is the `DUAL` table coming from? | ||
$this->markTestSkipped('Can not be executed'); | ||
|
||
|
||
$query = "SELECT :param as test FROM DUAL"; | ||
|
||
$stmt = $this->statementContainer->prepare($query); | ||
$stmt->execute(array(":param" => 5)); | ||
$this->assertEquals(array("5"), $stmt->fetchAll(\PDO::FETCH_COLUMN)); | ||
|
||
$stmt2 = $this->statementContainer->prepare($query); | ||
$stmt2->execute(array(":param" => 4)); | ||
$this->assertEquals(array("4"), $stmt2->fetchAll(\PDO::FETCH_COLUMN)); | ||
|