@@ 208-221 (lines=14) @@ | ||
205 | $this->_conn->insert("notnull_table", array('id' => 1, 'value' => null)); |
|
206 | } |
|
207 | ||
208 | public function testInvalidFieldNameException() |
|
209 | { |
|
210 | $schema = new \Doctrine\DBAL\Schema\Schema(); |
|
211 | ||
212 | $table = $schema->createTable("bad_fieldname_table"); |
|
213 | $table->addColumn('id', 'integer', array()); |
|
214 | ||
215 | foreach ($schema->toSql($this->_conn->getDatabasePlatform()) as $sql) { |
|
216 | $this->_conn->exec($sql); |
|
217 | } |
|
218 | ||
219 | $this->expectException(Exception\InvalidFieldNameException::class); |
|
220 | $this->_conn->insert("bad_fieldname_table", array('name' => 5)); |
|
221 | } |
|
222 | ||
223 | public function testNonUniqueFieldNameException() |
|
224 | { |
|
@@ 259-270 (lines=12) @@ | ||
256 | $this->_conn->insert("unique_field_table", array('id' => 5)); |
|
257 | } |
|
258 | ||
259 | public function testSyntaxErrorException() |
|
260 | { |
|
261 | $table = new \Doctrine\DBAL\Schema\Table("syntax_error_table"); |
|
262 | $table->addColumn('id', 'integer', array()); |
|
263 | $table->setPrimaryKey(array('id')); |
|
264 | ||
265 | $this->_conn->getSchemaManager()->createTable($table); |
|
266 | ||
267 | $sql = 'SELECT id FRO syntax_error_table'; |
|
268 | $this->expectException(Exception\SyntaxErrorException::class); |
|
269 | $this->_conn->executeQuery($sql); |
|
270 | } |
|
271 | ||
272 | /** |
|
273 | * @dataProvider getSqLiteOpenConnection |