PHP Classes

File: tests/eMapper/SQLite/InsertionTest.php

Recommend this page to a friend!
  Classes of Emmanuel Antico   eMapper   tests/eMapper/SQLite/InsertionTest.php   Download  
File: tests/eMapper/SQLite/InsertionTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: eMapper
Database abstraction layer that maps data types
Author: By
Last change:
Date: 10 years ago
Size: 693 bytes
 

Contents

Class file image Download
<?php
namespace eMapper\SQLite;

use
eMapper\SQLite\SQLiteTest;

/**
 * Tests inserting a blob into a SQLite database
 * @author emaphp
 * @group sqlite
 * @group blob
 */
class InsertionTest extends SQLiteTest {
    public function
setUp() {
       
self::$mapper->sql("CREATE TEMP TABLE \"blob_test\" ( \"test_id\" INTEGER NOT NULL, value BLOB);");
    }
   
    public function
testInsert() {
       
self::$mapper->query("INSERT INTO blob_test VALUES (1, %{blob})", self::$blob);
       
$row = self::$mapper->type('obj')->query("SELECT * FROM blob_test WHERE test_id = 1");
       
$this->assertEquals(self::$blob, $row->value);
    }
   
    public function
tearDown() {
       
self::$mapper->sql("DROP TABLE \"blob_test\";");
    }
}

?>