All Data Structures Namespaces Files Functions Variables Pages
ModelBaseTest.php
Go to the documentation of this file.
<?php
class ModelBaseTest extends PHPUnit_Framework_TestCase
{
public function testModelCreation()
{
list($server, $mysqlConfig) = require("test/config.php");
$dbh = new PDO($mysqlConfig[4][0], $mysqlConfig[1], $mysqlConfig[2]);
$dbh->exec("DROP DATABASE ".$mysqlConfig[4][1]);
$dbh->exec("CREATE DATABASE ".$mysqlConfig[4][1]);
\Entity\ModelBase::init($mysqlConfig);
$context = new \Tools\Context($server, false);
\Entity\ModelBase::setup();
}
public function testInstallFailure()
{
list($server, $mysqlConfig) = require("test/config.php");
$dbh = new PDO($mysqlConfig[4][0], $mysqlConfig[1], $mysqlConfig[2]);
$dbh->exec("DROP DATABASE ".$mysqlConfig[4][1]);
\Entity\ModelBase::init($mysqlConfig);
$context = new \Tools\Context($server, false);
$this->assertFalse(\Entity\ModelBase::setup());
}
}
Entity\ModelBase\init
static init($config=null)
Definition: ModelBase.php:23
Entity
Definition: Address.php:3
ModelBaseTest\testInstallFailure
testInstallFailure()
Definition: ModelBaseTest.php:16
ModelBaseTest\testModelCreation
testModelCreation()
Definition: ModelBaseTest.php:5
ModelBaseTest
Definition: ModelBaseTest.php:3
Entity\ModelBase\setup
static setup()
Definition: ModelBase.php:53
$context
$context
Definition: index.php:6