1--TEST--
2PDO Common: Bug #44159: SQLite variant
3--EXTENSIONS--
4pdo_sqlite
5--FILE--
6<?php
7$pdo = new PDO("sqlite:".__DIR__."/foo.db");
8$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
9
10try {
11    var_dump($pdo->setAttribute(PDO::NULL_TO_STRING, NULL));
12} catch (\TypeError $e) {
13    echo $e->getMessage(), \PHP_EOL;
14}
15var_dump($pdo->setAttribute(PDO::NULL_TO_STRING, 1));
16try {
17    var_dump($pdo->setAttribute(PDO::NULL_TO_STRING, 'nonsense'));
18} catch (\TypeError $e) {
19    echo $e->getMessage(), \PHP_EOL;
20}
21
22@unlink(__DIR__."/foo.db");
23
24?>
25--EXPECT--
26Attribute value must be of type int for selected attribute, null given
27bool(true)
28Attribute value must be of type int for selected attribute, string given
29