All Data Structures Namespaces Files Functions Variables Pages
ContextTest.php
Go to the documentation of this file.
<?php
class ContextTest extends PHPUnit_Framework_TestCase
{
public function testContext()
{
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();
$this->assertEquals("127.0.0.10", $context->ip);
$this->assertEquals($context, \Tools\Context::getContext());
try {
$i = $context->undefinedAttribute;
$this->fail("Expected exception");
}
catch (\Exception $e)
{ }
}
}
$i
function $i(n, t, e)
Definition: d3.min.js:2
Entity\ModelBase\init
static init($config=null)
Definition: ModelBase.php:23
Exception
Definition: Error404.php:3
ContextTest
Definition: ContextTest.php:3
Entity\ModelBase\setup
static setup()
Definition: ModelBase.php:53
Tools
Definition: AController.php:3
$context
$context
Definition: index.php:6
ContextTest\testContext
testContext()
Definition: ContextTest.php:5