assertEquals(DbType::NULL, DbType::detect(null)); $this->assertEquals(DbType::INTEGER, DbType::detect(12345)); $this->assertEquals(DbType::FLOAT, DbType::detect(123.45)); $this->assertEquals(DbType::STRING, DbType::detect('This is a string.')); $blob = fopen('php://memory', 'r+b'); if($blob === false) throw new RuntimeException('failed to fopen a memory stream'); fwrite($blob, 'This is a string inside a memory stream.'); fseek($blob, 0); $this->assertEquals(DbType::BLOB, DbType::detect($blob)); } }