public function testDBQueryFailure() { $this->setExpectedException('Exception'); $dbConfig = new DBConfig('tests/data/MysqliDBTest1.json'); $example = new MysqliDB($dbConfig); $query = "SELECT * FROM `not_a_real_table`"; $result = $example->Query($query); }
<?php use Method\Common\Config\DBConfig; use Method\Common\DB\MysqliDB; require_once 'vendor/autoload.php'; $dbConfig = new DBConfig('tests/data/MysqliDBTest1.json'); $example = new MysqliDB($dbConfig); /* @var mysqli $db */ //$db = $example->getMysqli(); $query = "SELECT * FROM `test`"; $result = $example->Query($query); //$result = $db->query($query); //$res = $result->getResult(); //$res->free(); //$result = $example->Query($query); //$result->free(); //this file's sole purpose is to test all things within; comment or uncomment that which you don't want to test... // use Method\Common\Cache\Cache; // function TestCache(){ // // to test the cache we should do a few things // // 1. a. Loading the cache that we know doesn't exist // // b. Loading the cache that we know does exist // // // // 2. a. Access data we know is not there // // b. Access data we know is there // // // // 3. Check the remove works // // 4. Check the clear works // $cacheOne = new Cache("cacheOne",false,false,false,10); // $cacheTwo = new Cache("cacheTwo"); // $cacheOneFile = $cacheOne->GetCacheLocation();