<?php require_once 'PHPUnit/Framework.php'; require_once '../../../sys/sys.php'; uses('sys.app.config'); Config::LoadEnvironment('test'); uses('system.data.database'); /** * Tests basic PGSQL Driver functionality */ class PGSQL extends PHPUnit_Framework_TestCase { protected $db; protected function setUp() { $this->db = Database::Get('default'); $this->db->execute_file(PATH_ROOT . 'sql/pgsql/test.sql'); } public function testGetDatabase() { $this->assertNotNull($this->db); } public function testInsert() { $id = $this->db->insert('test.test', 'id', array('intv' => 12, 'floatv' => 1234.34, 'stringv' => 'neat', 'textv' => 'cat', 'boolv' => 'false', 'datev' => '12/12/2009')); $this->assertEquals($id, 1); } public function testUpdate() { $id = $this->db->insert('test.test', 'id', array('intv' => 12, 'floatv' => 1234.34, 'stringv' => 'neat', 'textv' => 'cat', 'boolv' => 'false', 'datev' => '12/12/2009')); $this->assertEquals($id, 1);
<? include '../sys/sys.php'; uses('sys.app.config'); uses('sys.app.dispatcher'); uses('sys.utility.profiler'); Config::LoadEnvironment(); Profiler::Init(); // start buffering ob_start(); // dispatch the request Dispatcher::Dispatch(null,PATH_APP.'controller/', PATH_APP.'view/'); // flush the buffer ob_flush();
/** * Loads the test environment */ public function testEnvironment() { Config::LoadEnvironment('test'); $this->assertTrue(Config::$environment == 'test'); }