ecom
E-commerce cms
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
home
isundil
Project
ecom
test
tools
ContextTest.php
Go to the documentation of this file.
1
<?php
2
3
class
ContextTest
extends
PHPUnit_Framework_TestCase
4
{
5
public
function
testContext
()
6
{
7
list($server, $mysqlConfig) = require(
"test/config.php"
);
8
$dbh =
new
PDO($mysqlConfig[4][0], $mysqlConfig[1], $mysqlConfig[2]);
9
$dbh->exec(
"DROP DATABASE "
.$mysqlConfig[4][1]);
10
$dbh->exec(
"CREATE DATABASE "
.$mysqlConfig[4][1]);
11
12
\Entity\ModelBase::init
($mysqlConfig);
13
$context
= new \Tools\Context($server,
false
);
14
\Entity\ModelBase::setup
();
15
16
$this->assertEquals(
"127.0.0.10"
,
$context
->ip);
17
$this->assertEquals(
$context
, \
Tools
\Context::getContext());
18
try
{
19
$i
=
$context
->undefinedAttribute;
20
$this->fail(
"Expected exception"
);
21
}
22
catch
(\
Exception
$e)
23
{ }
24
}
25
}
26
$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
Generated on Wed Aug 5 2015 00:55:56 for ecom by
1.8.8