atk4\data\tests\SQLTestCase::setUp PHP Method

setUp() public method

public setUp ( )
    public function setUp()
    {
        parent::setUp();
        // establish connection
        $this->db = new Persistence_SQL(($this->debug ? 'dumper:' : '') . 'sqlite::memory:');
    }

Usage Example

Example #1
0
 public function setUp()
 {
     parent::setUp();
     $s = new \atk4\data\tests\Structure(['connection' => $this->db->connection]);
     $x = clone $s;
     $x->table('account')->drop()->id()->field('name')->create();
     $x = clone $s;
     $x->table('document')->drop()->id()->field('reference')->field('contact_from_id')->field('contact_to_id')->field('doc_type')->field('amount', ['type' => 'decimal(8,2)'])->create();
     $x = clone $s;
     $x->table('payment')->drop()->id()->field('document_id', ['type' => 'integer'])->field('account_id', ['type' => 'integer'])->field('cheque_no')->field('misc_payment', ['type' => 'enum("N","Y")'])->field('transfer_document_id')->create();
 }