Example #1
0
<?php

error_reporting(E_ALL | E_STRICT | E_PARSE);
ini_set('display_errors', 'on');
// declare a mingo autoloader we can use...
include_once join(DIRECTORY_SEPARATOR, array(join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', '..', 'Mingo')), 'MingoAutoload.php'));
MingoAutoload::register();
abstract class MingoTestBase extends PHPUnit_Framework_TestCase
{
    /**
     * looks like assertType was removed from PHPUnit, this just adds it back
     */
    public function assertType($expected, $actual, $message = '')
    {
        return $this->assertInternalType($expected, $actual, $message);
    }
    //method
    /**
     * get an orm, but one that can write to a SQLite db so we can test db stuff
     *
     * returns the same orm as getOrm(), but also has a live db connection
     *
     * @since 2013-3-14
     * @return  MingoOrm
     */
    protected function getDbConnectedOrm()
    {
        $test_db = new MingoSQLiteInterfaceTest();
        $db = $test_db->getDb();
        $t = $this->getOrm();
        $t->setDb($db);
Example #2
0
 /**
  *  unregister this autoloader from the spl autoload stack
  *
  *  @since  8-22-11
  */
 public static function unregister()
 {
     self::$is_registered = false;
     return spl_autoload_unregister(array(__CLASS__, 'load'));
 }