ecom
E-commerce cms
 All Data Structures Namespaces Files Functions Variables Pages
ModelBaseTest.php
Go to the documentation of this file.
1 <?php
2 
3 class ModelBaseTest extends PHPUnit_Framework_TestCase
4 {
5  public function testModelCreation()
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  \Entity\ModelBase::init($mysqlConfig);
12  $context = new \Tools\Context($server, false);
14  }
15 
16  public function testInstallFailure()
17  {
18  list($server, $mysqlConfig) = require("test/config.php");
19  $dbh = new PDO($mysqlConfig[4][0], $mysqlConfig[1], $mysqlConfig[2]);
20  $dbh->exec("DROP DATABASE ".$mysqlConfig[4][1]);
21  \Entity\ModelBase::init($mysqlConfig);
22  $context = new \Tools\Context($server, false);
23  $this->assertFalse(\Entity\ModelBase::setup());
24  }
25 }
26 
static init($config=null)
Definition: ModelBase.php:23
static setup()
Definition: ModelBase.php:53
$context
Definition: index.php:6